newRPL - build 1255 released! [updated to 1299]
01-09-2018, 03:49 PM
Post: #106
 Claudio L. Senior Member Posts: 1,884 Joined: Dec 2013
RE: newRPL - build 1001 released! [update:build 1016]
(01-08-2018 05:37 AM)BarryMead Wrote:  Claudio: I have a question. Why does the square root function return an "Approximate" value when the root is a whole number like 9 √ yelds 3. , but the
Xth root of Y function returns an "Exact" value? 9 2 XROOT yields 3 ? I would expect BOTH functions to return "Exact" 3 with these inputs, but they are inconsistent, why?

To make this puzzle more curious, the square root of 25 returns an "Exact" value 5 , with no decimal point. All other perfect integer squares between 1 and 12 return an "Approximate" value.
1 √ yelds 1.
4 √ yields 2.
9 √ yields 3.
16 √ yields 4.
25 √ yields 5 <-- Note: No Decimal point!
36 √ yields 6.
49 √ yields 7.
64 √ yields 8.
81 √ yields 9.
100 √ yields 10.
121 √ yields 11.
144 √ yields 12.
I confirmed that the XROOT function with the X value of 2 in all of these cases returns the "Exact" value as expected. 16 2 XROOT yields 4 for instance.

i also discovered that only powers of 5 squared will return an exact result if you take the square root of that squared number.
.5 SQ √ yields .5 exact
5 SQ √ yields 5 exact
50 SQ √ yields 50 exact
500 SQ √ yields 500 exact etc.

I realize that the "Exact" and "Approximate" distinction is small, but I think it is strange, and anomalous behavior never the less.

It uses an approximated method, so they should all be approximated. But sometimes the numerical method might converge exactly to the value after some iterations. Since the iterations use divisions, any number that has factors of 2 and 5 can be represented exactly. I didn't check in detail every iteration, but if the method has all exact divisions for a certain number it's final result will be exact.
 « Next Oldest | Next Newest »