]> git.proxmox.com Git - rustc.git/blob - vendor/libm/README.md
New upstream version 1.53.0+dfsg1
[rustc.git] / vendor / libm / 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
5 A port of [MUSL]'s libm to Rust.
6
7 [MUSL]: https://www.musl-libc.org/
8
9 ## Goals
10
11 The 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
13 term 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
21 This 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
28 extern crate libm;
29
30 use libm::F32Ext; // adds methods to `f32`
31
32 fn foo(x: f32) {
33 let y = x.sqrt();
34 let z = libm::truncf(x);
35 }
36 ```
37
38 The API documentation can be found [here](https://docs.rs/libm).
39
40 ## Contributing
41
42 Please check [CONTRIBUTING.md](CONTRIBUTING.md)
43
44 ## License
45
46 Licensed 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
52 at your option.
53
54 ### Contribution
55
56 Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
57 work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
58 additional terms or conditions.