Logic test returning unexpected answer
|
11-20-2015, 04:57 PM
Post: #1
|
|||
|
|||
Logic test returning unexpected answer
2^(-x) == 1/(2^x) is returning 0. Any idea why?
|
|||
11-20-2015, 05:08 PM
Post: #2
|
|||
|
|||
RE: Logic test returning unexpected answer
Not surprising, because == doesn't do any and all simplifications for you.
Try (x-1)*(x+1) == x^2-1 also returns 0. But x^2-1 == x^2-1 returns 1. |
|||
11-20-2015, 05:31 PM
(This post was last modified: 11-20-2015 05:38 PM by pwarmuth.)
Post: #3
|
|||
|
|||
RE: Logic test returning unexpected answer | |||
11-20-2015, 06:17 PM
Post: #4
|
|||
|
|||
RE: Logic test returning unexpected answer
Yes, don't skimp on the '*'!
|
|||
11-20-2015, 10:05 PM
Post: #5
|
|||
|
|||
RE: Logic test returning unexpected answer
Using the method, simplify(f-g)==0, works pretty well - where f ang g are the two items being compared.
For example: simplify(2^(-x) - 1/(2^x))==0 |
|||
11-20-2015, 10:42 PM
(This post was last modified: 11-21-2015 01:23 PM by Fortin.)
Post: #6
|
|||
|
|||
RE: Logic test returning unexpected answer
(11-20-2015 05:31 PM)pwarmuth Wrote: Ok, that makes sense. This is because the intended implied multiplication involving 1/4 is calling 'of' instead of '*'. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)