NTU-ALComLab / ssatABC

Stochastic SAT solver within ABC
Other
5 stars 2 forks source link

Wrong parsing for floating numbers with more than six digits #5

Closed nianzelee closed 4 years ago

nianzelee commented 4 years ago

https://github.com/nianzelee/ssatABC/blob/9c7e7d770bfadd5db007ad7301e7409899856000/src/ssat/utils/ParseUtils.h#L96-L116

The above parsing function cannot correctly parse floating numbers with more than six digits. A more robust function to parse floating numbers is needed.

As an example, for the following prefix:

r 0.52630084998192672163 1 0
r 0.45145173859870524335 2 0
r 0.83495322437974206498 3 0
r 0.41920503619210280899 4 0
r 0.98843744785517617668 5 0
r 0.26323313845700235802 6 0
r 0.43681107395014884265 7 0
r 0.08623731804172130033 8 0
r 0.21192652520292631912 9 0
r 0.20060022340739380731 10 0
r 0.91477328411715319589 11 0
r 0.20345975384353698345 12 0
r 0.06396060330772390667 13 0
r 0.74896047193349835069 14 0
r 0.75684804346402301256 15 0
r 0.56730550695077519574 16 0
r 0.44843752378555956639 17 0
r 0.76693948326429861595 18 0
r 0.13321462449488596924 19 0
r 0.35205296135790853373 20 0
r 0.76820904035949444388 21 0
r 0.07981500077462766463 22 0
r 0.00356466227469398600 23 0

the function parses every probability to a very small number (close to 0).

yen-shi commented 4 years ago

Send PR: https://github.com/nianzelee/ssatABC/pull/6