Equation validator (==) problem
|
05-08-2020, 12:34 PM
Post: #1
|
|||
|
|||
Equation validator (==) problem
So I have this inconvenience when using my calculator to check if what I think is the same thing actually is the same thing. This is really handy when comparing equations while shortening them.
So here is the problem: I input 2*2==4 and I get a 1, which means it's true. And then I input 9^(1/2)==3 and I still get a 1. The problem occurs when I input 9^(1/2)==(-3) because then I get a 0. Why do I get a 0 and is there any way to have the calculator display a 1 instead? |
|||
05-08-2020, 12:55 PM
Post: #2
|
|||
|
|||
RE: Equation validator (==) problem | |||
05-08-2020, 02:29 PM
Post: #3
|
|||
|
|||
RE: Equation validator (==) problem | |||
05-08-2020, 03:42 PM
Post: #4
|
|||
|
|||
RE: Equation validator (==) problem
Hi, DrD
XCas (1.5.0-63 win32) support chained comparison , but not fully short circuiting. XCas> f(x) := {print(x);x} XCas> f(1) < f(2) < f(3) < f(-1) < f(-2) < f(-3) x:1 x:2 x:2 x:3 x:-1 x:-3 → false Python 2.6: >>> def f(x): print x; return x ... >>> f(1) < f(2) < f(3) < f(-1) < f(-2) < f(-3) 1 2 3 -1 False |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)