• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..20-Jan-2022-

ci/H20-Jan-2022-225182

src/H20-Jan-2022-12,7588,533

.cargo-checksum.jsonH A D03-May-202289 11

CHANGELOG.mdH A D20-Jan-20221.2 KiB9880

CONTRIBUTING.mdH A D20-Jan-20223.4 KiB9670

Cargo.tomlH A D20-Jan-20221 KiB3532

LICENSE-APACHEH A D20-Jan-202210.6 KiB202169

LICENSE-MITH A D20-Jan-20221 KiB2622

README.mdH A D20-Jan-20221.7 KiB5936

azure-pipelines.ymlH A D20-Jan-20222.1 KiB7469

build.rsH A D20-Jan-202214.9 KiB445364

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