lexical_util::algorithm

Function cannot_overflow

Source
pub fn cannot_overflow<T: Integer>(length: usize, radix: u32) -> bool
Expand description

Check to see if parsing the float cannot possible overflow.

This allows major optimizations for those types, since we can skip checked arithmetic.

Adapted from the rust corelib.

core: https://doc.rust-lang.org/1.81.0/src/core/num/mod.rs.html#1389