0

I am currently playing around with matlab and noticed one of my true false statements should be true (I think)

When I input

    % output gives 0 for false and 1 for true
    x=10^7
    disp(x^21/x^6==x^15)

The output is 0

Why is that so?

When I use a smaller value like 1-10 it seems to give an output of 1.

SillyGoose
  • 15
  • 5
  • You’re running into floating-point rounding errors, see the linked Q&A. Never do exact equality comparison with computed floating-point values. – Cris Luengo Sep 20 '21 at 01:26

0 Answers0