This problem is hard due the precision error that floating-point numbers have. The number 0.1 may not be equal to 0.1, be careful.
i am surprised to see why the same thing doesn't work when kept in decimal
594 Solvers
Find nearest prime number less than input number
268 Solvers
185 Solvers
286 Solvers
309 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!