File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,21 @@ Check [PR #65] for an example.
28
28
have any external dependencies (other than ` core ` itself).
29
29
30
30
- Only use relative imports within the ` math ` directory / module, e.g. ` use self::fabs::fabs ` or
31
- ` use super::isnanf ` . Absolute imports from core are OK, e.g. ` use core::u64 ` .
31
+ ` use super::k_cos ` . Absolute imports from core are OK, e.g. ` use core::u64 ` .
32
32
33
33
- To reinterpret a float as an integer use the ` to_bits ` method. The MUSL code uses the
34
34
` GET_FLOAT_WORD ` macro, or a union, to do this operation.
35
35
36
36
- To reinterpret an integer as a float use the ` f32::from_bits ` constructor. The MUSL code uses the
37
37
` SET_FLOAT_WORD ` macro, or a union, to do this operation.
38
38
39
+ - You may use other methods from core like ` f64::is_nan ` , etc. as appropriate.
40
+
41
+ - If you're implementing one of the private double-underscore functions, take a look at the
42
+ "source" name in the comment at the top for an idea for alternate naming. For example, ` __sin `
43
+ was renamed to ` k_sin ` after the FreeBSD source code naming. Do ` use ` these private functions in
44
+ ` mod.rs ` .
45
+
39
46
- You may encounter weird literals like ` 0x1p127f ` in the MUSL code. These are hexadecimal floating
40
47
point literals. Rust (the language) doesn't support these kind of literals. The best way I have
41
48
found to deal with these literals is to turn them into their integer representation using the
You can’t perform that action at this time.
0 commit comments