move a chunk of the README into CONTRIBUTING.md

This commit is contained in:
Jorge Aparicio
2018-07-13 17:52:58 -05:00
parent 169dfb4ad7
commit aaa56fba35
5 changed files with 105 additions and 52 deletions

View File

@@ -355,7 +355,7 @@ impl F32Ext for f32 {
}
}
/// Math support for `f32`
/// Math support for `f64`
///
/// This trait is sealed and cannot be implemented outside of `libm`.
pub trait F64Ext: private::Sealed {

View File

@@ -22,3 +22,11 @@ pub fn trunc(x: f64) -> f64 {
i &= !m;
f64::from_bits(i)
}
#[cfg(test)]
mod tests {
#[test]
fn sanity_check() {
assert_eq!(super::trunc(1.1), 1.0);
}
}

View File

@@ -22,3 +22,11 @@ pub fn truncf(x: f32) -> f32 {
i &= !m;
f32::from_bits(i)
}
#[cfg(test)]
mod tests {
#[test]
fn sanity_check() {
assert_eq!(super::truncf(1.1), 1.0);
}
}