The Octave interpreter evaluates this expression as false:
>> 2/3 + 1/6 == 5/6
ans = 0
cause
>> 2/3 + 1/6 - 5/6
ans = -1.11022302462516e-16
This can be avoided with the rat
(or rats
) function, or casting the values, but the resulting expression lacks the clear formatting of the initial one:
>> all(rat(2/3 + 1/6) == rat(5/6))
ans = 1
>> single(2/3 + 1/6) == single(5/6)
ans = 1
When using Octave to teach kids arithmetic, 'dirty' translations of mathematical expressions are of no use.
Is there any global adjustment that could be done to evaluate as true
the original expression?