1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Software floating-point arithmetic on binary32, binary64 and x87 80-bit encodings.
//! The library uses integer arithmetic and requires no allocator or global state.
//!
//! The core exposes [`Single`], [`Double`] and [`Extended`]. Operations take a
//! [`nan::NanPolicy`] type parameter and report [`Flags`]. The [`x86`] facade
//! selects the x86 NaN policy, detects tininess after rounding and reports
//! architectural exception bits.
//!
//! [`Computed::Finished`] carries a value and its flags. [`Computed::Unfinished`]
//! carries an intermediate that the caller rounds for the destination.
//! Even an exact result can need a range response: half the smallest normal
//! number is a denormal under masked rounding but triggers exponent adjustment
//! for an unmasked x87 register underflow. [`Computed::settle`] calls the
//! supplied rounding function only for an unfinished result.
//!
//! # Example
//!
//! ```
//! use softfpu::{Double, Flags, Rounding, Tininess};
//! use softfpu::x86::{Exceptions, Real, X86};
//!
//! let one = Double::from_i32(1);
//! let ten = Double::from_i32(10);
//! let mode = Rounding::Nearest;
//!
//! let core = one.divide::<X86>(ten)
//! .settle(|q| q.round(mode, Tininess::AfterRounding));
//! let sse = <Double as Real>::divide(one, ten)
//! .settle(|q| <Double as Real>::round(q, mode));
//!
//! assert_eq!(core.value, Double(0x3fb9_9999_9999_999a));
//! assert_eq!(sse.value, core.value);
//! assert_eq!(core.exceptions, Flags::INEXACT);
//! assert_eq!(sse.exceptions, Exceptions::PE);
//! ```
pub use Relation;
pub use InvalidConversion;
pub use ;
pub use ;
pub use ;