Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 20-Jan-2022 | - | ||||
ci/ | H | 20-Jan-2022 | - | 225 | 182 | |
src/ | H | 20-Jan-2022 | - | 12,758 | 8,533 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
CHANGELOG.md | H A D | 20-Jan-2022 | 1.2 KiB | 98 | 80 | |
CONTRIBUTING.md | H A D | 20-Jan-2022 | 3.4 KiB | 96 | 70 | |
Cargo.toml | H A D | 20-Jan-2022 | 1 KiB | 35 | 32 | |
LICENSE-APACHE | H A D | 20-Jan-2022 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | H A D | 20-Jan-2022 | 1 KiB | 26 | 22 | |
README.md | H A D | 20-Jan-2022 | 1.7 KiB | 59 | 36 | |
azure-pipelines.yml | H A D | 20-Jan-2022 | 2.1 KiB | 74 | 69 | |
build.rs | H A D | 20-Jan-2022 | 14.9 KiB | 445 | 364 |
README.md
1# `libm` 2 3[![Build Status](https://dev.azure.com/rust-lang/libm/_apis/build/status/rust-lang-nursery.libm?branchName=master)](https://dev.azure.com/rust-lang/libm/_build/latest?definitionId=7&branchName=master) 4 5A port of [MUSL]'s libm to Rust. 6 7[MUSL]: https://www.musl-libc.org/ 8 9## Goals 10 11The short term goal of this library is to [enable math support (e.g. `sin`, `atan2`) for the 12`wasm32-unknown-unknown` target][wasm] (cf. [rust-lang-nursery/compiler-builtins][pr]). The longer 13term goal is to enable [math support in the `core` crate][core]. 14 15[wasm]: https://github.com/rust-lang-nursery/libm/milestone/1 16[pr]: https://github.com/rust-lang-nursery/compiler-builtins/pull/248 17[core]: https://github.com/rust-lang-nursery/libm/milestone/2 18 19## Already usable 20 21This crate is [on crates.io] and can be used today in stable `#![no_std]` programs like this: 22 23[on crates.io]: https://crates.io/crates/libm 24 25``` rust 26#![no_std] 27 28extern crate libm; 29 30use libm::F32Ext; // adds methods to `f32` 31 32fn foo(x: f32) { 33 let y = x.sqrt(); 34 let z = libm::truncf(x); 35} 36``` 37 38The API documentation can be found [here](https://docs.rs/libm). 39 40## Contributing 41 42Please check [CONTRIBUTING.md](CONTRIBUTING.md) 43 44## License 45 46Licensed under either of 47 48- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or 49 http://www.apache.org/licenses/LICENSE-2.0) 50- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) 51 52at your option. 53 54### Contribution 55 56Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the 57work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any 58additional terms or conditions. 59