Function simics::api::base::attr_value::attr_floating
source · pub fn attr_floating(attr: &AttrValue) -> Result<f64>
Expand description
Get an AttrValue
as a f64
§Arguments
attr
- TheAttrValue
to attempt to get as af64
§Return Value
The contained floating point value if the AttrValue
is the correct type, or an
error otherwise.
§Notes
Conversion via TryInto
should be preferred. For example:
ⓘ
let x: f64 = a.try_into()?;
§Context
All Contexts