why "x/(x>0)" produce the same graph as "If(x>0,x)" ?

guyuming shared this question 4 days ago
Answered

i can input something like If(x>0, x) in Algebra zone, it works fine;


but if i input some like x/(x>0), it shows the same graph. why?


i can see that the "/" is parsed as DIVIDE in java code:


04b04c8d5d8226020ee2d6f0c1363e85

Comments (4)

photo
1

x>0 is either true (1) or false (0)

photo
1

thanks! but if logical value true and false are treated as numerical value 1 and 0, why doesn't "x>0" produce the same graph as "if(x>0,1,0)" ?

4a8aef9cf68c5eaf1df5950e483d13dc


if the conversion from true/false to 1/0 is implicit in some context, is there an explicit function for this?

photo
1

What result precisely are you expecting from x/(x>0)?

photo
photo
1

Whether inequalities are treated as numerical values depends on context. If you input an inequality, it's exactly that - an inequality - for Geogebra, and if it's one with only variables x and y and not too complicated (see https://wiki.geogebra.org/e... for details) then the Graphics view shows the corresponding area. (The yellow half plane in your example.)

© 2021 International GeoGebra Institute