(&mut self, prop: &Prop)
| 300 | } |
| 301 | #[inline(always)] |
| 302 | pub fn decode_float(&mut self, prop: &Prop) -> Option<f32> { |
| 303 | let val = self.decode_special_float(prop)?; |
| 304 | |
| 305 | if val != 0.0 { |
| 306 | Some(val as f32) |
| 307 | } else { |
| 308 | let mut interp = 1; |
| 309 | if prop.num_bits != -1 { |
| 310 | interp = self.read_nbits(prop.num_bits as u32)?; |
| 311 | } |
| 312 | let mut val = (interp / (1 << (prop.num_bits - 1))) as f32; |
| 313 | val = prop.low_value + (prop.high_value - prop.low_value) * (val as f32); |
| 314 | Some(val) |
| 315 | } |
| 316 | } |
| 317 | #[inline(always)] |
| 318 | pub fn decode_int(&mut self, prop: &Prop) -> Option<u32> { |
| 319 | let flags = prop.flags; |
no test coverage detected