> Why does $int() accept strings containing floating-point numbers, like
> "78.5"? It seems that it would make more sense for it to only accept
> strings not containing a decimal point. That way, you don't have to
> check if there's a decimal point in the string before passing it to
> $int(). Right now, what is arguably an error isn't being reported.
> 
> - Chris Rebert

$int currently follow the same specification as the C function "atoi".
It could actually be enforced to only accept ([0-9]+|0x[0-9A-F]+)
expressions, but that would require a similar implementation for $float,
which is more tricky.

Nicolas

-- 
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to