Skip to content
A port of MUSL's libm to Rust.
Branch: master
Clone or download
Latest commit 3559e70 Oct 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cb test source importing this crate Jul 13, 2018
ci
examples omit bounds check in release mode Jul 25, 2018
input-generator
math add newlib support to the test generator Jul 27, 2018
musl-generator
newlib-generator add newlib support to the test generator Jul 27, 2018
shared add newlib support to the test generator Jul 27, 2018
src
.gitignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md Add some extra notes to CONTRIBUTING Jul 14, 2018
Cargo.toml
LICENSE-APACHE
LICENSE-MIT initial commit Jul 12, 2018
README.md

README.md

libm

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.

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.

You can’t perform that action at this time.