Skip to content

Commit

Permalink
Add test case for rust-lang#170
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Schultzer <benjamin@schultzer.com>
  • Loading branch information
Schultzer committed Jul 2, 2019
1 parent 885afa3 commit 443434f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/math/jn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,18 @@ pub fn yn(n: i32, x: f64) -> f64 {
b
}
}

#[cfg(test)]
mod test {

#[test]
pub fn issue_170() {
let expected = f64::from_bits(1617394868955);
let result = super::jn(114, f64::from_bits(4594974205335009568));
assert!(crate::_eq(result, expected).is_ok());

let expected = f64::from_bits(15924833);
let result = super::jn(136, f64::from_bits(4602429132083530282));
assert!(crate::_eq(result, expected).is_ok());
}
}
11 changes: 11 additions & 0 deletions src/math/jnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,14 @@ pub fn ynf(n: i32, x: f32) -> f32 {
b
}
}

#[cfg(test)]
mod test {

#[test]
pub fn issue_170() {
let expected = f32::from_bits(86);
let result = super::jnf(29, f32::from_bits(1061546867));
assert!(crate::_eqf(result, expected).is_ok());
}
}

0 comments on commit 443434f

Please sign in to comment.