+ 7
Why is ("1e3" == "1000") true?
<?php if("1e3" == "1000") echo "wow"; else echo "nop"; ?> Is true and print "wow"; Could someone explain it to me?
6 ответов
+ 10
I think this is scientific notation used for numbers
1000 = 10^3 = 1 * 10^3 = 1 e3
and after some trial and error i think this is true
try this ->
100 == 1e2
300 == 3e2
5000 == 5e3
+ 6
Yeah it works in php I don't know why.
in the string the first letter represents the number first letter.The "E" does the real thing.the third letter represents number of 0's
1e3==1000
1e1==10
1e4==10000
4e3==4000
+ 2
echo 1e8;
works too btw. :-)
Thanks!
+ 1
why did u use dollar symbol