unequal computed values
Brought to you by:
rexx
For the REXX program (using all versions of Regina from 3.2 --> 3.9.1):
/*REXX*/ parse version v; say 'REXX version:' v H=249 numeric digits max(9,length((H**5)*4)) say 'digits=' digits() x=H**5 say 'value of x=' x y=H**5 + 0 say 'value of y=' y if x==y then say 'x and y are exactly equal.' else say "x and y aren't exactly equal." if x =y then say 'x and y are equal.' else say "x and y aren't equal."
The output of the REXX program:
REXX version: REXX-Regina_3.9.1(MT) 5.00 5 Apr 2015 digits= 14 value of x= 9.57186876E+11 value of y= 957186876249 x and y aren't exactly equal. x and y aren't equal.
I don't understand why Regina REXX is putting the value of X
in exponential notation (with 14 numeric digits), and why,
even after normalization (by adding zero), the value of Y
is so much different that X.
___________________________ Gerard Schildberger
Y is not "much" different from x - the percent difference is a little over 2.6E-08.
The real bug is x being expressed in fewer than DIGITS() significant figures, and it's stored that way since x+0 evaluates to 957186876000.
Interestnig that
and
evaluate to different results. Something about being involved in a more complicated expression makes ** behave correctly!
And this shows that it is definitely in the '**' function:
Last edit: Paul Kislanko 2015-06-12