isNumeric in Phobos(D1&D2) seems bugged

Sergey Gromov snake.scaly at gmail.com
Mon Feb 11 08:28:36 PST 2008


badmadevil <badmadevil at gmail.com> wrote:
> ============================= isnum.d
> import std.stdio ;
> import std.string ;
> void main(string[] args) {
>   for(int i = 1 ; i< args.length ; i++)
>     writefln("\"%s\" is%s a numeric.", args[i], isNumeric(args[i], true)? "": " not") ;
> }
> ============================= output
> >isnum.exe 9.9e+99 99e+9.9 9.9e+9.9
> "9.9e+99" is a numeric.
> "99e+9.9" is a numeric.
> "9.9e+9.9" is not a numeric.
> 
> The last one should give affirmative.

Yes, I think there is a bug, too.  Though not where you're pointing it 
out.  D doesn't support fractional exponents.  This means that both 
"99e+9.9" and "9.9e+9.9" are not numbers.

-- 
SnakE


More information about the Digitalmars-d-bugs mailing list