+ 2

I don't understand why 7<7.0?

8th Mar 2017, 8:01 PM
Tom Harvey
Tom Harvey - avatar
5 odpowiedzi
+ 15
7<7.0 is the same as 7<7. It is a bit confusing using two different data types, but it will outputs false since 7 is equal to 7 and not smaller...
10th Mar 2017, 5:53 PM
Gami
Gami - avatar
+ 6
Nope, it's not :)
8th Mar 2017, 8:09 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
7<=7.0
8th Mar 2017, 8:08 PM
Meharban Singh
Meharban Singh - avatar
+ 2
numbers with floating point may have very small errors. In basic calculations those errors may come out as 7.0000000000000001 or 6.9999999999999999. That's it.
9th Mar 2017, 8:59 AM
Norayr Gasparyan
Norayr Gasparyan - avatar