- #1
catsarebad
- 72
- 0
i'm trying to learn MATLAB and as such i stumbled here while looking something up
http://www.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html
so the questions is
how does someone avoid something like
e = 1 - 3*(4/3 - 1) (this is example 1 in the webpage above)
not being zero
or this not being zero
sin(pi) (this is in example 1 again)
or this being zero
sqrt(1e-16 + 1) - 1 (in example 2)
thank you very much!
http://www.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html
so the questions is
how does someone avoid something like
e = 1 - 3*(4/3 - 1) (this is example 1 in the webpage above)
not being zero
or this not being zero
sin(pi) (this is in example 1 again)
or this being zero
sqrt(1e-16 + 1) - 1 (in example 2)
thank you very much!