ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 18 May 2015 03:37:17 -0500Problem with assumption (in RR)http://ask.sagemath.org/question/26854/problem-with-assumption-in-rr/ Hello,
The following code returns the value "False", and I don't understand why. Does 'assume' and 'in RR' work fine together ?
sage: var('alpha')
sage: assume(alpha,'real')
sage: alpha in RR
False
Thank you by advance
Please excuse me for the mistakes, I'm French.
Mon, 18 May 2015 00:55:15 -0500http://ask.sagemath.org/question/26854/problem-with-assumption-in-rr/Answer by tmonteil for <p>Hello,</p>
<p>The following code returns the value "False", and I don't understand why. Does 'assume' and 'in RR' work fine together ?</p>
<pre><code>sage: var('alpha')
sage: assume(alpha,'real')
sage: alpha in RR
False
</code></pre>
<p>Thank you by advance
Please excuse me for the mistakes, I'm French.</p>
http://ask.sagemath.org/question/26854/problem-with-assumption-in-rr/?answer=26857#post-id-26857 When you write `var('alpha')` you define a symbolic variable, whose role is to serve as an indeterminate in symbolic expressions such as `exp(alpha)/log(alpha+pi)`. When you write `assume(alpha,'real')`, you add the hint that this symbolic variable serves as a real indeterminate, the system can use this information during its computations (e.g. when simplifying formulas).
Despite its generic name, `RR` is not an abstraction representing the reals, but one of the available approximations of the real field, namely `RR` is made of floating-point numbers with 53 bits of precision, so we are quite far from the symbolic ring, in particular, there is no way to transform a symbol into a floating-point number.
Mon, 18 May 2015 03:37:17 -0500http://ask.sagemath.org/question/26854/problem-with-assumption-in-rr/?answer=26857#post-id-26857