• FPOUT for Win32Forth

    From dxforth@21:1/5 to All on Thu Mar 30 18:23:49 2023
    I've ported my floating-point output package FPOUT to Win32Forth 6.15.05.
    It replaces the existing functions.

    Installation requires replacing two files and running Win32F's Setup.exe.

    Download FPOUT_Win32F.zip from:

    https://drive.google.com/drive/folders/1kh2WcPUc3hQpLcz7TQ-YQiowrozvxfGw

    Instructions included. Any problems - let me know. Good luck!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@21:1/5 to dxforth on Thu Mar 30 02:33:39 2023
    dxforth schrieb am Donnerstag, 30. März 2023 um 09:23:52 UTC+2:
    I've ported my floating-point output package FPOUT to Win32Forth 6.15.05.
    It replaces the existing functions.

    Installation requires replacing two files and running Win32F's Setup.exe.

    What is the additional benefit against the proven original?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to minforth on Thu Mar 30 22:20:35 2023
    On 30/03/2023 8:33 pm, minforth wrote:
    dxforth schrieb am Donnerstag, 30. März 2023 um 09:23:52 UTC+2:
    I've ported my floating-point output package FPOUT to Win32Forth 6.15.05.
    It replaces the existing functions.

    Installation requires replacing two files and running Win32F's Setup.exe.

    What is the additional benefit against the proven original?

    All I know that's been proven is the system Forth uses - namely <# #> to
    hold the numeric string. Be that as it may, Win32Forth users now have
    two systems to try out - which is one more than they had yesterday. I'm
    not sure how that's a bad thing. As for what prompted me, it was watching
    this video and concluding there had to be an easier way:

    https://youtu.be/HSglsp3fNxE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to dxforth on Fri Mar 31 10:47:45 2023
    On 30/03/2023 6:23 pm, dxforth wrote:
    I've ported my floating-point output package FPOUT to Win32Forth 6.15.05.
    It replaces the existing functions.

    Installation requires replacing two files and running Win32F's Setup.exe.

    Download FPOUT_Win32F.zip from:

    https://drive.google.com/drive/folders/1kh2WcPUc3hQpLcz7TQ-YQiowrozvxfGw

    Instructions included.  Any problems - let me know.  Good luck!

    While not critical there was a step omitted from the installation procedure:

    f) Select 'U' from the menu [Rebuild HELP database]

    This allows users to type HELP (F.) and get the new specification.

    The ZIP above has been updated to include the missing installation step.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to dxforth on Fri Mar 31 11:58:45 2023
    On 30/03/2023 10:20 pm, dxforth wrote:

    As for what prompted me, it was watching
    this video and concluding there had to be an easier way:

    https://youtu.be/HSglsp3fNxE

    Here's the F.A function from the video implemented using FPOUT. Since FPOUT permits display in either decimal places or significant digits, I've created two versions of the F.A function. While decimal places is more commonly used, significant digits has its uses e.g. in engineering notation.

    \ Decimal-point align
    : DP-ALIGN ( adr len col# -- adr len #spaces )
    >r 2dup [char] . scan nip over - r> + 0 max ;

    : F.A1 ( F: r -- ) ( col# #dpl -- )
    (f.) rot dp-align spaces type ;

    : F.A2 ( F: r -- ) ( col# #sig -- )
    set-precision -1 (f.) rot dp-align spaces type ;

    \\

    : test1 ( r -- ) cr ." Decimal places"
    6 0 do cr ." |" fdup 10 i f.a1 loop fdrop ;

    : test2 ( r -- ) cr ." Significant digits"
    8 2 do cr ." |" fdup 10 i f.a2 loop fdrop ;

    123.456e test1
    Decimal places
    | 123.
    | 123.5
    | 123.46
    | 123.456
    | 123.4560
    | 123.45600 ok

    2e3 3e f/ test1
    Decimal places
    | 667.
    | 666.7
    | 666.67
    | 666.667
    | 666.6667
    | 666.66667 ok

    123.456e test2
    Significant digits
    | 120.
    | 123.
    | 123.5
    | 123.46
    | 123.456
    | 123.456 ok

    2e3 3e f/ test2
    Significant digits
    | 670.
    | 667.
    | 666.7
    | 666.67
    | 666.667
    | 666.6667 ok

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to minforth@arcor.de on Fri Mar 31 11:07:57 2023
    In article <727a0dce-6a07-40e8-90a3-07600ef4df19n@googlegroups.com>,
    minforth <minforth@arcor.de> wrote:
    dxforth schrieb am Donnerstag, 30. März 2023 um 09:23:52 UTC+2:
    I've ported my floating-point output package FPOUT to Win32Forth 6.15.05.
    It replaces the existing functions.

    Installation requires replacing two files and running Win32F's Setup.exe.

    What is the additional benefit against the proven original?

    After seeing Bill Ragdale's video I concluded that there is no
    comprehensive output package for floating point as yet in Win32Forth,
    so he developped it.
    Pitting a simpler alternative to Bill's work is commendable.

    Let the best system win, or maybe a synthesis come out of this,
    and is added to Win32Forth.

    Groetjes Albert
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat spinning. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to minforth on Thu Apr 6 13:52:42 2023
    On 30/03/2023 8:33 pm, minforth wrote:
    dxforth schrieb am Donnerstag, 30. März 2023 um 09:23:52 UTC+2:
    I've ported my floating-point output package FPOUT to Win32Forth 6.15.05.
    It replaces the existing functions.

    Installation requires replacing two files and running Win32F's Setup.exe.

    What is the additional benefit against the proven original?

    Here's a brief comparison.

    Original
    --------
    6 set-precision ok
    fpi f. 3.14159 ok
    fpi 1e10 f* f. 31415900000. ok
    fpi 1e-10 f* f. .000000 ok

    1 set-precision
    -1e 0e f/ f. -I ok

    Remarks: Mixes notions of significant digits and decimal places. PRECISION impacts NAN/INF display. Float string output require users to specify a buffer.

    FPOUT
    -----
    6 set-precision ok
    fpi f. 3.14159 ok
    fpi 1e10 f* f. 31415900000. ok
    fpi 1e-10 f* f. 0.000000000314159 ok

    fpi 6 0 f.r 3.141593 ok
    fpi 1e10 f* 6 0 f.r 31415926535.897920 ok
    fpi 1e-10 f* 6 0 f.r 0.000000 ok

    1 set-precision ok
    -1e 0e f/ f. -INF ok

    Remarks: Bona-fide decimal places. Significant digits offered as a separate mode.
    NAN/INF display unaffected by PRECISION. Float output strings are held in forth's
    numeric buffer.

    In summary, FPOUT has good functionality, is simple to use and consumes very little
    resources. I'm not sure there's a better forth implementation but I'll leave that
    for others to judge.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to dxforth on Sat Apr 8 11:24:50 2023
    On 30/03/2023 6:23 pm, dxforth wrote:
    I've ported my floating-point output package FPOUT to Win32Forth 6.15.05.
    It replaces the existing functions.

    Installation requires replacing two files and running Win32F's Setup.exe.

    Download FPOUT_Win32F.zip from:

    https://drive.google.com/drive/folders/1kh2WcPUc3hQpLcz7TQ-YQiowrozvxfGw

    Instructions included.  Any problems - let me know.  Good luck!

    I've corrected the following:

    - F.S F.X SEE were disabled during debugging but not restored
    - REPRESENT didn't work correctly for values > MAX-PRECISION

    Download FPOUT_Win32F_v2.zip from the link shown above.

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