First time here? Check out the FAQ!

Ask Your Question
0

Problem with assumption (in RR)

asked 9 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 9 years ago

tmonteil gravatar image

updated 9 years ago

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.

Preview: (hide)
link

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: 9 years ago

Seen: 409 times

Last updated: May 19 '15