octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Symbolica package warning: Using rat() heuristics for double-precisi


From: Colin Macdonald
Subject: Re: Symbolica package warning: Using rat() heuristics for double-precision input (is this what you wanted?)
Date: Fri, 17 Feb 2017 10:01:12 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 17/02/17 09:17, Mike Miller wrote:
No, there is something magic about the double value returned by pi.

The function that converts numeric values has special code to test
whether a given double value is exactly pi (to the extent of double
precision), and replaces that with the string value "pi" for SymPy to
evaluate.

Yes: so using vpa('pi') is probably a good habit.

Basically anytime you are passing a double into "sym" or "vpa", you should think carefully about what you are doing.

I considered having "vpa" give the "rats" warning or something similar so "vpa(pi/2)" would give a warning to help folks learn this. But maybe its a valid thing to do, unlike "sym(1.23)" which almost certainly wrong.

Colin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]