I just found a strange problem in the ruby ββof a programming language, this is not a big problem, but I just can not understand why this is happening. I would be interested if someone knows the problem for my problem.
In ruby ββyou can write 0 or 00 , it does not matter, it comes to the same result.
If you run 0 === 00 , you will also get true , which means the two inputs are the same.
0.0 also 0 , so logically 00.0 should also be 0.0 , but the problem is that if you try to use the number 00.0 , then you will get an error. If you run, for example:
a = 00.0
You will get this error:
syntax error, unexpected tINTEGER
Of course, I know that this is a small problem, but, as I said, I would like to understand why the computer does not treat 00.0 as well as 0.0 ?
ruby numbers
evotopid
source share