softposit 0.4.0

Implementation of Posit numbers
Documentation
1
2
3
4
5
6
7
8
9
10
use softposit::{P32, Q32};

fn main() {
    // c == 12.3*0.4 - 6.3*8.4 == -48;
    let mut q = Q32::init();
    q += (P32::from(12.3), P32::from(0.4));
    q -= (P32::from(6.3), P32::from(8.4));
    let c = q.to_posit();
    println!("c = {0} or c = {0:?}", c);
}