correctly parse all integer types. fixes #9289

Used `parseint` and `parsefloat` methods instead of `float64_isvalid`.

It will probably be useful to have versions of `parseint` and `parsefloat` that indicate failure instead of throwing an exception.