Function std::f64::from_str_hex
pub fn from_str_hex(num: &str) -> Option<f64>
Convert a string in base 16 to a float. Accepts an optional binary exponent.
This function accepts strings such as
- 'a4.fe'
- '+a4.fe', equivalent to 'a4.fe'
- '-a4.fe'
- '2b.aP128', or equivalently, '2b.ap128'
- '2b.aP-128'
- '.' (understood as 0)
- 'c.'
- '.c', or, equivalently, '0.c'
- '+inf', 'inf', '-inf', 'NaN'
Leading and trailing whitespace represent an error.
Arguments
- num - A string
Return value
None
if the string did not represent a valid number. Otherwise,
Some(n)
where n
is the floating-point number represented by [num]
.