I wrote:
Also the index is wrong for huge numbers. At some point the indexing should just give up and use max/min values, but I suppose at least cryptograpy-sized numbers should be usefully indexed. I.e. at least two length bytes.
Eeh. It makes more sense to check for ridiculous-sized numbers before parsing them and just output a min/max value depending on sign. (Or right-truncate e.g. n*12 digits and add n*5 to the length.) Anyway, this needs the numbers to be normalized before passed to index/filter functions. Are they? With different valid text representations of the same number it gets hard to check against the cut-off size.