#floating-point #numeric #scientific-computing #operations #approximate #wrapper #function

nightly fastfloat

Fast-math wrapper and convenient numeric functions for approximate floating point operations in Rust

4 releases

0.2.2 Jan 27, 2019
0.2.1 Jan 27, 2019
0.2.0 Jan 26, 2019
0.1.0 Jan 26, 2019

#2216 in Algorithms

Download history 3/week @ 2024-02-19 4/week @ 2024-02-26 75/week @ 2024-04-01

75 downloads per month

MIT/Apache

12KB
263 lines

fastfloat

Latest version Documentation

Inspired and based on @bluss's fast-floats: https://github.com/bluss/fast-floats

I wrote this to speed up my numeric projects, but it should be useful for most scientific computing applications.

The API is unstable and subject to change. A nightly rustc is required. Any feedback, bug reports, and pull requests are very welcome.

Example

use fastfloat::*;

fn main() {
    let v:Vec<F32> = (0..1000).map(|x| (fa(x as f32) * 0.01).fastexp()).collect();
    let s:F32 = v.iter().sum();
    
    println!("Sum: {}, Avg: {}", s, s / 1e3);
}

License

Dual-licensed to be compatible with the Rust project.

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.

Dependencies

~155KB