Skip to main content

parse_finite_f64

Function parse_finite_f64 

Source
fn parse_finite_f64(s: &str, line: usize) -> Result<f64, ParseError>
Expand description

Parse a floating-point literal, rejecting non-finite values (NaN, inf, -inf).

Non-finite values are meaningless as SC constants/parameters, and NaN in particular breaks the parse/print round-trip because NaN != NaN: a graph carrying NaN can never compare equal to its own re-parse. Rejecting them at parse time keeps the text format total under round-tripping.