Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 651455d

Browse files
committed
Common private function needs to be no_panic
1 parent ff51032 commit 651455d

File tree

17 files changed

+34
-1
lines changed

17 files changed

+34
-1
lines changed

src/math/acos.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const QS3: f64 = -6.88283971605453293030e-01; /* 0xBFE6066C, 0x1B8D0159 */
4949
const QS4: f64 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
5050

5151
#[inline]
52+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
5253
fn r(z: f64) -> f64 {
5354
let p: f64 = z * (PS0 + z * (PS1 + z * (PS2 + z * (PS3 + z * (PS4 + z * PS5)))));
5455
let q: f64 = 1.0 + z * (QS1 + z * (QS2 + z * (QS3 + z * QS4)));

src/math/acosf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const P_S2: f32 = -8.6563630030e-03;
2323
const Q_S1: f32 = -7.0662963390e-01;
2424

2525
#[inline]
26+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
2627
fn r(z: f32) -> f32 {
2728
let p = z * (P_S0 + z * (P_S1 + z * P_S2));
2829
let q = 1. + z * Q_S1;

src/math/asin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const Q_S3: f64 = -6.88283971605453293030e-01; /* 0xBFE6066C, 0x1B8D0159 */
5656
const Q_S4: f64 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
5757

5858
#[inline]
59+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
5960
fn comp_r(z: f64) -> f64 {
6061
let p = z * (P_S0 + z * (P_S1 + z * (P_S2 + z * (P_S3 + z * (P_S4 + z * P_S5)))));
6162
let q = 1.0 + z * (Q_S1 + z * (Q_S2 + z * (Q_S3 + z * Q_S4)));

src/math/asinf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const P_S2: f32 = -8.6563630030e-03;
2525
const Q_S1: f32 = -7.0662963390e-01;
2626

2727
#[inline]
28+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
2829
fn r(z: f32) -> f32 {
2930
let p = z * (P_S0 + z * (P_S1 + z * P_S2));
3031
let q = 1. + z * Q_S1;

src/math/erf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ const SB5: f64 = 2.55305040643316442583e+03; /* 0x40A3F219, 0xCEDF3BE6 */
172172
const SB6: f64 = 4.74528541206955367215e+02; /* 0x407DA874, 0xE79FE763 */
173173
const SB7: f64 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */
174174

175+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
175176
fn erfc1(x: f64) -> f64 {
176177
let s: f64;
177178
let p: f64;
@@ -184,6 +185,7 @@ fn erfc1(x: f64) -> f64 {
184185
1.0 - ERX - p / q
185186
}
186187

188+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
187189
fn erfc2(ix: u32, mut x: f64) -> f64 {
188190
let s: f64;
189191
let r: f64;

src/math/erff.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const SB5: f32 = 2.5530502930e+03; /* 0x451f90ce */
8383
const SB6: f32 = 4.7452853394e+02; /* 0x43ed43a7 */
8484
const SB7: f32 = -2.2440952301e+01; /* 0xc1b38712 */
8585

86+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
8687
fn erfc1(x: f32) -> f32 {
8788
let s: f32;
8889
let p: f32;
@@ -94,6 +95,7 @@ fn erfc1(x: f32) -> f32 {
9495
return 1.0 - ERX - p / q;
9596
}
9697

98+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
9799
fn erfc2(mut ix: u32, mut x: f32) -> f32 {
98100
let s: f32;
99101
let r: f32;

src/math/fma.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ struct Num {
1111
}
1212

1313
#[inline]
14+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
1415
fn normalize(x: f64) -> Num {
1516
let x1p63: f64 = f64::from_bits(0x43e0000000000000); // 0x1p63 === 2 ^ 63
1617

@@ -31,6 +32,7 @@ fn normalize(x: f64) -> Num {
3132
}
3233

3334
#[inline]
35+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3436
fn mul(x: u64, y: u64) -> (u64, u64) {
3537
let t1: u64;
3638
let t2: u64;

src/math/hypot.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use super::sqrt;
55
const SPLIT: f64 = 134217728. + 1.; // 0x1p27 + 1 === (2 ^ 27) + 1
66

77
#[inline]
8+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
89
fn sq(x: f64) -> (f64, f64) {
910
let xh: f64;
1011
let xl: f64;

src/math/j0.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const INVSQRTPI: f64 = 5.64189583547756279280e-01; /* 0x3FE20DD7, 0x50429B6D */
5959
const TPI: f64 = 6.36619772367581382433e-01; /* 0x3FE45F30, 0x6DC9C883 */
6060

6161
/* common method when |x|>=2 */
62+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6263
fn common(ix: u32, x: f64, y0: bool) -> f64 {
6364
let s: f64;
6465
let mut c: f64;

src/math/j0f.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use super::{cosf, fabsf, logf, sinf, sqrtf};
1818
const INVSQRTPI: f32 = 5.6418961287e-01; /* 0x3f106ebb */
1919
const TPI: f32 = 6.3661974669e-01; /* 0x3f22f983 */
2020

21+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
2122
fn common(ix: u32, x: f32, y0: bool) -> f32 {
2223
let z: f32;
2324
let s: f32;
@@ -219,6 +220,7 @@ const PS2: [f32; 5] = [
219220
1.4657617569e+01, /* 0x416a859a */
220221
];
221222

223+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
222224
fn pzerof(x: f32) -> f32 {
223225
let p: &[f32; 6];
224226
let q: &[f32; 5];
@@ -331,6 +333,7 @@ const QS2: [f32; 6] = [
331333
-5.3109550476e+00, /* 0xc0a9f358 */
332334
];
333335

336+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
334337
fn qzerof(x: f32) -> f32 {
335338
let p: &[f32; 6];
336339
let q: &[f32; 6];

0 commit comments

Comments
 (0)