Ask Your Question

Problem with assumption (in RR)

asked 2015-05-18 00:55:15 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.


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

Thank you by advance Please excuse me for the mistakes, I'm French.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-05-18 03:37:17 -0500

tmonteil gravatar image

updated 2015-05-18 05:18:17 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-05-18 00:55:15 -0500

Seen: 39 times

Last updated: May 19 '15