softfpu 0.3.0

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
//! SSE conversions between binary32 and binary64. [`super::Real`] provides the arithmetic operations.

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

/// Widens binary32 exactly. A NaN keeps its sign and leading payload bits.
/// A signalling NaN raises invalid.
#[inline]
pub fn from_single(value: Single) -> (Double, Flags) {
    Double::from_single::<X86>(value)
}

/// 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>()
}