Thread: float()
View Single Post
  #13  
Old 08-17-2010, 08:50 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by Skyld View Post
This is intentional since it allows extra notation to be correctly parsed:
PHP Code:
echo(float("1.0e4")); // 10000
echo(float("0xBC"));  // 188 
It's not like it'd be impossible to make a parser which only accepts those variants when a letter is encountered.

I also don't think it matters that this is "how it usually works" in dynamically-typed languages, since a lot of other languages do dumb things.


But the important fact is that this behavior already exists and bugs may be introduced if it is changed.
Reply With Quote