Skip to content

Commit c108db9

Browse files
authored
Merge pull request rust-lang#265 from ankane/no_panic
2 parents 2af4e21 + e4c6d24 commit c108db9

20 files changed

+26
-6
lines changed

src/math/acosh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const LN2: f64 = 0.693147180559945309417232121458176568; /* 0x3fe62e42, 0xfefa3
77
/// Calculates the inverse hyperbolic cosine of `x`.
88
/// Is defined as `log(x + sqrt(x*x-1))`.
99
/// `x` must be a number greater than or equal to 1.
10+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
1011
pub fn acosh(x: f64) -> f64 {
1112
let u = x.to_bits();
1213
let e = ((u >> 52) as usize) & 0x7ff;

src/math/acoshf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const LN2: f32 = 0.693147180559945309417232121458176568;
77
/// Calculates the inverse hyperbolic cosine of `x`.
88
/// Is defined as `log(x + sqrt(x*x-1))`.
99
/// `x` must be a number greater than or equal to 1.
10+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
1011
pub fn acoshf(x: f32) -> f32 {
1112
let u = x.to_bits();
1213
let a = u & 0x7fffffff;

src/math/asinh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const LN2: f64 = 0.693147180559945309417232121458176568; /* 0x3fe62e42, 0xfefa3
77
///
88
/// Calculates the inverse hyperbolic sine of `x`.
99
/// Is defined as `sgn(x)*log(|x|+sqrt(x*x+1))`.
10+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
1011
pub fn asinh(mut x: f64) -> f64 {
1112
let mut u = x.to_bits();
1213
let e = ((u >> 52) as usize) & 0x7ff;

src/math/asinhf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const LN2: f32 = 0.693147180559945309417232121458176568;
77
///
88
/// Calculates the inverse hyperbolic sine of `x`.
99
/// Is defined as `sgn(x)*log(|x|+sqrt(x*x+1))`.
10+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
1011
pub fn asinhf(mut x: f32) -> f32 {
1112
let u = x.to_bits();
1213
let i = u & 0x7fffffff;

src/math/atanh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use super::log1p;
55
///
66
/// Calculates the inverse hyperbolic tangent of `x`.
77
/// Is defined as `log((1+x)/(1-x))/2 = log1p(2x/(1-x))/2`.
8+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
89
pub fn atanh(x: f64) -> f64 {
910
let u = x.to_bits();
1011
let e = ((u >> 52) as usize) & 0x7ff;

src/math/atanhf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use super::log1pf;
55
///
66
/// Calculates the inverse hyperbolic tangent of `x`.
77
/// Is defined as `log((1+x)/(1-x))/2 = log1p(2x/(1-x))/2`.
8+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
89
pub fn atanhf(mut x: f32) -> f32 {
910
let mut u = x.to_bits();
1011
let sign = (u >> 31) != 0;

src/math/copysign.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
///
33
/// Constructs a number with the magnitude (absolute value) of its
44
/// first argument, `x`, and the sign of its second argument, `y`.
5+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
56
pub fn copysign(x: f64, y: f64) -> f64 {
67
let mut ux = x.to_bits();
78
let uy = y.to_bits();

src/math/copysignf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
///
33
/// Constructs a number with the magnitude (absolute value) of its
44
/// first argument, `x`, and the sign of its second argument, `y`.
5+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
56
pub fn copysignf(x: f32, y: f32) -> f32 {
67
let mut ux = x.to_bits();
78
let uy = y.to_bits();

src/math/erf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ fn erfc2(ix: u32, mut x: f64) -> f64 {
219219
/// Calculates an approximation to the “error function”, which estimates
220220
/// the probability that an observation will fall within x standard
221221
/// deviations of the mean (assuming a normal distribution).
222+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
222223
pub fn erf(x: f64) -> f64 {
223224
let r: f64;
224225
let s: f64;

src/math/erff.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ fn erfc2(mut ix: u32, mut x: f32) -> f32 {
130130
/// Calculates an approximation to the “error function”, which estimates
131131
/// the probability that an observation will fall within x standard
132132
/// deviations of the mean (assuming a normal distribution).
133+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
133134
pub fn erff(x: f32) -> f32 {
134135
let r: f32;
135136
let s: f32;

0 commit comments

Comments
 (0)