First time here? Check out the FAQ!

Ask Your Question
1

Why doesn't Sage return `True` for `e < 3`?

asked 4 years ago

vdeangel gravatar image

updated 4 years ago

slelievre gravatar image

I would like to know why Sage does not return True if I type e < 3 or False for pi > 4. Is there a way to have that as output?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 4 years ago

eric_g gravatar image

You have to enforce the check of the inequality by asking for a Boolean:

sage: bool(e<3)                                                                                    
True
sage: bool(pi>4)                                                                                   
False
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

1 follower

Stats

Asked: 4 years ago

Seen: 192 times

Last updated: Feb 01 '21