File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,30 @@ term goal is to enable [math support in the `core` crate][core].
14
14
[ pr ] : https://github.com/rust-lang-nursery/compiler-builtins/pull/248
15
15
[ core ] : https://github.com/japaric/libm/milestone/2
16
16
17
+ ## Already usable
18
+
19
+ This crate is [ on crates.io] and can be used today in stable ` #![no_std] ` programs like this:
20
+
21
+ [ on crates.io ] : https://crates.io/crates/libm
22
+
23
+ ``` rust
24
+ #![no_std]
25
+
26
+ extern crate libm;
27
+
28
+ use libm :: F32Ext ; // adds methods to `f32`
29
+
30
+ fn foo (x : f32 ) {
31
+ let y = x . sqrt ();
32
+ let z = libm :: truncf (x );
33
+ }
34
+ ```
35
+
36
+ Not all the math functions are available at the moment. Check the [ API docs] to learn what's
37
+ currently supported.
38
+
39
+ [ API docs ] : https://docs.rs/libm
40
+
17
41
## Contributing
18
42
19
43
Please check [ CONTRIBUTING.md] ( CONTRIBUTING.md )
You can’t perform that action at this time.
0 commit comments