softfpu 0.2.2

32-, 64- and 80-bit floating-point arithmetic in safe Rust, including Intel x87 transcendental functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! SSE conversions between binary32 and binary64. [`super::Real`] provides the arithmetic operations.

use super::{Computed, Double, Exceptions, Single, X86};

/// Widens binary32 exactly. A NaN keeps its sign and leading payload bits.
/// A signalling NaN raises IE.
#[inline]
pub fn from_single(value: Single) -> (Double, Exceptions) {
    let (converted, flags) = Double::from_single::<X86>(value);
    (converted, Exceptions::from(flags))
}

/// Narrows binary64 to binary32 with the x86 NaN policy. Finite nonzero
/// inputs return an intermediate for the destination rounding.
#[inline]
pub fn to_single(value: Double) -> Computed<Single> {
    value.to_single::<X86>().map_exceptions(Exceptions::from)
}