Open adesutherland opened 4 years ago
Note that 1e7 + 0 works fine ...
Hello,
we, the other BREXXers, have been experimenting at this point for a long time. In the end, we gave up the subject. To my knowledge, there are architectural precision problems with floating point numbers on 360/370.
See https://en.wikipedia.org/wiki/IBM_hexadecimal_floating_point#Precision_issues https://en.wikipedia.org/wiki/IBM_hexadecimal_floating_point#Precision_issues
Attached is the output of your test:
READY
rexx float
12E7
120000001.000000008
120000000.000000008
Regards, Mike
Am 07.11.2020 um 09:46 schrieb Adrian Sutherland notifications@github.com:
Note that 1e7 + 0 works fine ...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adesutherland/CMS-370-BREXX/issues/47#issuecomment-723419501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF7Q7OXFC33OHV3GC3KQLTSOUCO7ANCNFSM4TNQWFMA.
Thanks Mike
I am sure there are issues with floating / rounding - just not sure if this is the root cause here. I have not had a chance to look at it yet but will report back.
One thing - at least with GCCLIB / PDPCLIB double precision maths is supported (well I gather it is actually an IBM's standard - HEX floating point) - but the point is it should support 15 digits precision comfortably. So the REXX default DIGITS 9 should be all good ("should be"!) ...
I have tried to keep each built in function fix in its own commit - so porting to MVS will be doable
Fixed in F0036
Basically BREXX does maths by converting integers to doubles does the operation then converts back to integers if both operations are integers ({sigh} performance!!). Anyway the F0036's fix of detecting if a float is an integer fixed this also.
Example program
Output
Maybe an error in SAY but more likely in conversion from Number (real?) to string