Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Comment Re:Numeric equality in PHP (Score 1) 729

In PHP, 1 === 1.0 and 1 === '1' are both false, and 1 == 1.0 and 1 == '1' are both true. What operator should the programmer use if he wants 1 to equal 1.0 but not '1', where integer numbers are equal to float numbers but strings aren't equal to either?

Since (almost) no computer actually stores 1.0; your request is, at best, naive.

Slashdot Top Deals

Breadth-first search is the bulldozer of science. -- Randy Goebel

Working...