Skip to content

Commit 07ca284

Browse files
bors[bot]porglezomp
andcommitted
102: Add some extra notes to CONTRIBUTING r=japaric a=porglezomp Co-authored-by: C Jones <code@calebjones.net>
2 parents f9f234f + dea92e4 commit 07ca284

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ Check [PR #65] for an example.
2828
have any external dependencies (other than `core` itself).
2929

3030
- 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`.
3232

3333
- To reinterpret a float as an integer use the `to_bits` method. The MUSL code uses the
3434
`GET_FLOAT_WORD` macro, or a union, to do this operation.
3535

3636
- To reinterpret an integer as a float use the `f32::from_bits` constructor. The MUSL code uses the
3737
`SET_FLOAT_WORD` macro, or a union, to do this operation.
3838

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+
3946
- You may encounter weird literals like `0x1p127f` in the MUSL code. These are hexadecimal floating
4047
point literals. Rust (the language) doesn't support these kind of literals. The best way I have
4148
found to deal with these literals is to turn them into their integer representation using the

0 commit comments

Comments
 (0)