On 22/08/2016 07:47,
magicmouse94937@gmail.com wrote:
I recently was doing a bunch of double precision floating point conversions to string,
using the ISO routines, from the library LongStr, and found that the
code form 1992 has
bugs in it, particularly related to large numbers. I have their
source code, but their
algorithm was weak.
What sorts of numbers does it fail on?
It seems more likely to me that it is due to an error in how the binary exponent is being handled in extremely large numbers.
Hard to comment further without seeing input, output and source code.
they have accumulated rounding errors due to repeated by 10. The easiest way on an intel
box is to use the floating point to BCD instructions, but am a little
rusty on the old
Macro Assembler, wondering if anyone out there has a more recent
version of the LongStr code.
If the number you want is in variable x and the destination is d.
FLD x
FRNDINT
FBSTP d
d will contain the BDC representation of the integer part of x
(provided that it will fit in the available space)
Beware that the rounding flag can cause trouble on some compilers.
--
Regards,
Martin Brown
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)