Post Reply 
Existing CAS commands --> Prime discussion
11-29-2018, 08:56 PM
Post: #44
RE: Existing CAS commands --> Prime discussion
(11-29-2018 05:51 PM)Joe Horn Wrote:  
(11-29-2018 05:18 PM)ijabbott Wrote:  Looking at the Giac/Xcas source code for exact and float2rational, they follow different code paths, but do similar things. The main functional difference seems to be that exact imposes a minimum epsilon value of 1e-14, whereas float2rational imposes a minimum epsilon value of 1e-11.

Prime's exact() function can be controlled by setting epsilon to any value between 1e-6 and 1e-15. Since the output of float2rational() can therefore be obtained by exact(), there is no need to add float2rational to the Prime's vocabulary... especially now that QPI is also available:

qpi(.324532453245) --> 295/909

I don't know if the minimum values of epsilon for exact() and float2rational() are different on the Prime, but the values I gave are accurate for the upstream Xcas source. I.e. for float2rational(), setting epsilon to anything less than 1e-11 behaves the same as setting it to 1e-11. Similarly for exact() with an epsilon less than 1e-14.

The float2rational() function sometimes "gives up" and gives you the float back, which is another reason for not implementing it!

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Existing CAS commands --> Prime discussion - ijabbott - 11-29-2018 08:56 PM



User(s) browsing this thread: 1 Guest(s)