Link o' the day: Ive been broken by Java.

Posted on March 11, 2013 by Tommy McGuire
Labels: link, java
From java.lang.Character#getNumericValue(char):
public static int getNumericValue(char ch)

Returns the int value that the specified Unicode character represents. For example, the character '\u216C' (the roman numeral fifty) will return an int with a value of 50.

The letters A-Z in their uppercase ('\u0041' through '\u005A'), lowercase ('\u0061' through '\u007A'), and full width variant ('\uFF21' through '\uFF3A' and '\uFF41' through '\uFF5A') forms have numeric values from 10 through 35. This is independent of the Unicode specification, which does not assign numeric values to these char values.

If the character does not have a numeric value, then -1 is returned. If the character has a numeric value that cannot be represented as a nonnegative integer (for example, a fractional value), then -2 is returned.

Note: This method cannot handle supplementary characters. To support all Unicode characters, including supplementary characters, use the getNumericValue(int) method.

Parameters:

ch - the character to be converted.

Returns:

the numeric value of the character, as a nonnegative int value; -2 if the character has a numeric value that is not a nonnegative integer; -1 if the character has no numeric value.

Since:

1.1

See Also:

forDigit(int, int), isDigit(char)

Ok, I'm with them on the first paragraph: int value of the Unicode character. But, A-Z, a-z, and their "full width" versions are 10-35? Then, -1 and -2? And it's not complete.

See forDigit and isDigit? I don't think so.

I would like to thank Del for inflicting this ghastly abomination on me. I would, really. But I can't.

active directory applied formal logic ashurbanipal authentication books c c++ comics conference continuations coq data structure digital humanities Dijkstra eclipse virgo electronics emacs goodreads haskell http java job Knuth ldap link linux lisp math naming nimrod notation OpenAM osgi parsing pony programming language protocols python quote R random REST ruby rust SAML scala scheme shell software development system administration theory tip toy problems unix vmware yeti
Member of The Internet Defense League
Site proudly generated by Hakyll.