New ZenFP I/O library posted

23 views
Skip to first unread message

The Beez

unread,
Apr 4, 2015, 2:05:12 PM4/4/15
to 4th-co...@googlegroups.com
Hi 4tH-ers!

If you ever used "lib/fp1.4th" for your programs you might have noticed that especially >FLOAT is fairly limited, accepting only integer number to the left and the right of the "E" sign with a maximum of MAX-N. This has changed. Sure, the lib is a bit bulkier now, but still around 200 opcodes. But >FLOAT is MUCH more versatile now. Sure, it will fail many ANS tests (especially in the "not allowed" section), but it will convert almost any FP number you can possibly throw at it, e.g.:

(it does fractions now)
-1234.34

(both the integer part as the fractional part can exceed MAX-N)
-12345678901234.12345678901234

(this goes down too very well)
-1234.4567e-2

(sure, this will work)
-1234e

(this too)
-1234.

And it will leave a ZERO number when it is fed an empty string.

So, next time you want a lean FP library, reconsider: you don't have to use "lib/fp2.4th" anymore if you need large and complex FP constants.

Hans Bezemer
Reply all
Reply to author
Forward
0 new messages