REXX/imc-beta-1.75 4.00 25 Feb 2002
x*x*x = x**3 is FALSE for x= 1.2599210498948731648 with NUMERIC DIGITS 20
It works with NUMERIC DIGITS 19!
x ** n is defined as x * x * ,,, with n x's, but evidently Regina uses a different implementation of **. For example:
With source
-------------------------------
/* Regina math bug? */
parse version ver
say ver
say ' '
numeric digits 20
cuberoot_2 = 1.2599210498948731648
product = cuberoot_2 * cuberoot_2 * cuberoot_2
power = cuberoot_2 ** 3
say 'x*x*x = x**3 is' word('FALSE TRUE',(product=power)+1) 'for x=' cuberoot_2 'with NUMERIC DIGITS' digits()
exit
-------------------------------
The output is
-------------------------------
REXX-Regina_3.7(MT) 5.00 14 Oct 2012
x*x*x = x**3 is FALSE for x= 1.2599210498948731648 with NUMERIC DIGITS 20
Press ENTER key to exit...
-------------------------------
REXX/imc-beta-1.75 4.00 25 Feb 2002
x*x*x = x**3 is FALSE for x= 1.2599210498948731648 with NUMERIC DIGITS 20
It works with NUMERIC DIGITS 19!
I think I was the "anonymous" here; in any case this is not a Regina bug.
TRL2 explains this. "**" works the way it does to ensure that it gives the same result in every implementation. It is not necessarily true that it gives the same result as repeated multiplication.
Closed due to OP explanation
Log in to post a comment.