Sometimes Octave shows a number that is very close to zero, instead of "real" zero.
e.g.:
>> sin(pi)
ans = 1.2246e-016
I understand that it's due to floating point arithmetic problems, and so on, but it's annoying...
Is there a way to get the expected 0
instead of some almost-zero value?
EDIT
A more real-life example is this:
>> cos(pi) + i*sin(pi)
ans = -1.0000e+000 + 1.2246e-016i
Applying some rounding function to the result won't help, and I don't want to insert rounding functions inside the calculation.
Isn't some way to tell Octave "to be less precise"?
Other, less sophisticated tools (like SpeedCrunch) do it "out-of-the-box":
cos(pi) + i*sin(pi)
= -1