D-Programming-Language/phobos — pull request #1052 by monarchdodra (2013-01-04 17:42:30+00:00)
Title: Numeric value for unicode

Note that this development is still under discussion at:
http://forum.dlang.org/thread/nnaebebtfwojtglhjjyk@forum.dlang.org

Pretty straight forward, and as discussed in the message boards.

"isNumber" was also added to std.ascii.

I did run into a couple of issues, namelly that I'm not getting 100% equivalence between chars that are numeric, and chars with numeric value... Is this normal...?

* There's a fair bit of chars that have numeric value, but aren't isNumber. I think they might be new in 6.1.0. But I'm not sure. I decided it was best to have them return nan, instead of having inconsistent behavior.
* There's a couple characters in tableLo that have numeric values. These aren't considered in isNumber either. I think this might be a bug though.
* There are 4 "non-number numeric" characters in "CUNEIFORM NUMERIC SIGN". These return wild values, and in particular two of them return -1. I *think* this should actually return nan for us, because (AFAIK), -1 is just wild for invalid :/

Maybe we should just return -1 on invalid unicode?

Anyways, please feel free to build on this, or destroy it.