• does anyone have corrected ISO library LongStr, compatible with Stony B

    From magicmouse94937@gmail.com@21:1/5 to All on Sun Aug 21 23:47:52 2016
    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.

    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.

    thanks

    edward

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Brown@21:1/5 to magicmouse94937@gmail.com on Mon Aug 22 14:00:19 2016
    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)
  • From Chris Burrows@21:1/5 to magicmo...@gmail.com on Tue Aug 23 00:59:07 2016
    On Monday, August 22, 2016 at 4:17:53 PM UTC+9:30, magicmo...@gmail.com wrote:
    wondering if anyone out there has a more recent version of the LongStr code.


    v2.28 of ADW Modula-2 included the source of LongStr with a copyright date of 2004. Unfortunately, the release notes of later versions of ADW include this statement:

    "Because of copyright issues, the source code of the implementation modules (MOD files) of the runtime libraries (RTL) has been removed from the package."

    Regards,
    Chris

    Chris Burrows
    CFB Software
    http://www.cfbsoftware.com/modula2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jan272@gmail.com@21:1/5 to magicmo...@gmail.com on Wed Aug 24 03:11:33 2016
    On Monday, August 22, 2016 at 8:47:53 AM UTC+2, magicmo...@gmail.com wrote:
    I recently was doing a bunch of double precision floating point conversions

    Some time ago I found the ULM Modula-2 package in a deserted directory. On it was RealConv.m2 I put it online. Not sure if you may copy it but it sure will be an inspiration for your own new modules....

    Get it on http://verhoeven272.nl/etc/RealConv.m2 while it lasts.

    It came from the tarball modula-src-3.0b8.tar.gz which should be out there on the web someplace.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)