rust/library/compiler-builtins/libm
Benjamin Schultzer 2cd88e96b1 Add benchmark suite
Signed-off-by: Benjamin Schultzer <benjamin@schultzer.com>
2019-07-01 18:37:23 -07:00
..
benches Add benchmark suite 2019-07-01 18:37:23 -07:00
ci Update Rust install task 2019-06-13 09:21:50 -07:00
crates/compiler-builtins-smoke-test Rework how testing is done 2019-05-02 10:48:55 -07:00
src Add benchmark suite 2019-07-01 18:37:23 -07:00
.gitignore add newlib support to the test generator 2018-07-27 00:11:06 -05:00
azure-pipelines.yml Add benchmark suite 2019-07-01 18:37:23 -07:00
build.rs fix jn, ilogb 2019-05-09 18:40:19 +03:00
Cargo.toml Add benchmark suite 2019-07-01 18:37:23 -07:00
CHANGELOG.md Add changelog entry for v0.1.4 release 2019-06-12 18:45:42 +02:00
CONTRIBUTING.md Update contributing docs 2019-05-02 12:12:47 -07:00
LICENSE-APACHE initial commit 2018-07-12 00:44:28 -05:00
LICENSE-MIT initial commit 2018-07-12 00:44:28 -05:00
README.md Add benchmark suite 2019-07-01 18:37:23 -07:00

libm

Build Status

A port of MUSL's libm to Rust.

Goals

The short term goal of this library is to enable math support (e.g. sin, atan2) for the wasm32-unknown-unknown target (cf. rust-lang-nursery/compiler-builtins). The longer term goal is to enable math support in the core crate.

Already usable

This crate is on crates.io and can be used today in stable #![no_std] programs like this:

#![no_std]

extern crate libm;

use libm::F32Ext; // adds methods to `f32`

fn foo(x: f32) {
    let y = x.sqrt();
    let z = libm::truncf(x);
}

The API documentation can be found here.

Benchmark

Run cargo +nightly bench

NOTE: remember to have nightly installed rustup install nightly

Contributing

Please check CONTRIBUTING.md

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.