Ask Your Question
0

Problem with assumption (in RR)

asked 2015-05-18 07:55:15 +0100

this post is marked as community wiki

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

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-05-18 10:37:17 +0100

tmonteil gravatar image

updated 2015-05-18 12:18:17 +0100

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

Stats

Asked: 2015-05-18 07:55:15 +0100

Seen: 345 times

Last updated: May 19 '15