Browse Source
Simon Guan reported Bug item #3509528, `Meas goes wrong when put in a while loop' In a .control block a `let' variable was passed to the `measure' command. The value of this variable would have been a plain integer, yet it was converted internally to an internal ascii representation with exponential representation (203 ==> 2.03e2) and then processed by `ft_numparse()' where it was converted back to double floating point. Because the intermediate 2.03 has no exact representation in the space of double floating point numbers this conversion was lossy and resulted in a non-integer value. This non-integer was then truncated towards minus infinity in com_measure yielding an error of -1 This commit implements round to nearest in com_measure2 to avoid the problem. FIXME, the internal intermediate conversion of double floating point machine values to ascii representations must be dropped, or replaced with an exact/lossless ascii representation. (for example GNU printf/scanf %a or 64bit hexadecimal representation)
1 changed files with 4 additions and 5 deletions
Loading…
Reference in new issue