Post Reply 
help with exact command. [Solved]
04-25-2016, 10:20 PM
Post: #5
RE: help with exact command.
(04-25-2016 08:33 PM)Spybot Wrote:  I can make 0.333 to become 1/3 by changing some HOMEsettings [number format:rounded & HDigits to 3]... it'll do the trick though, the thing is that... when I try to replicate those settings from within a program and attempt to do the same operation... it's not working as expected!

Changing the HOME settings as you do has an impact on the [a b/c] key in Home but not on the CAS exact() function which depends on the value of the CAS epsilon setting.

The following program does what you're looking for:
Code:
EXPORT z()
BEGIN
LOCAL M, saved_ep;
saved_ep:=CAS("epsilon");
CAS("epsilon:=0.001");
M:=0.333;
M:=exact(M);
PRINT(M);
CAS("epsilon:=saved_ep");
RETURN M;
END;

Note that the line:
Code:
CAS("epsilon:=saved_ep");
works only with the latest firmware version (10077) which allows the CAS to access local variables. With the previous version (8151) epsilon is not restored and remains at 0.001 at the end of the program.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
help with exact command. [Solved] - Spybot - 04-25-2016, 07:54 PM
RE: help with exact command. - Spybot - 04-25-2016, 08:33 PM
RE: help with exact command. - Didier Lachieze - 04-25-2016 10:20 PM
RE: help with exact command. - DrD - 04-25-2016, 09:27 PM
RE: help with exact command. - Spybot - 04-25-2016, 11:18 PM



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