If anyone claims this works with doubles, he's prolly lying. It's definitely returning an integer here. It looks like a hexadecimal converter to me. Though I don't get what the part in else does, the part in if extracts the number from the ascii digit.
EDIT: definitely Hex string to int converter. The part in if is for digits, the part in else for the lower case letters from a-f.