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

Commit eda2148

Browse files
committed
Ensure all public functions are marked no_panic
Fixes: #201
1 parent 1a0c172 commit eda2148

File tree

9 files changed

+15
-0
lines changed

9 files changed

+15
-0
lines changed

libm/src/math/frexpf.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
12
pub fn frexpf(x: f32) -> (f32, i32) {
23
let mut y = x.to_bits();
34
let ee: i32 = ((y >> 23) & 0xff) as i32;

libm/src/math/j0.rs

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const S03: f64 = 5.13546550207318111446e-07; /* 0x3EA13B54, 0xCE84D5A9 */
110110
const S04: f64 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */
111111

112112
/// Zeroth order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the first kind (f64).
113+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
113114
pub fn j0(mut x: f64) -> f64 {
114115
let z: f64;
115116
let r: f64;
@@ -164,6 +165,7 @@ const V03: f64 = 2.59150851840457805467e-07; /* 0x3E91642D, 0x7FF202FD */
164165
const V04: f64 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */
165166

166167
/// Zeroth order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f64).
168+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
167169
pub fn y0(x: f64) -> f64 {
168170
let z: f64;
169171
let u: f64;

libm/src/math/j0f.rs

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const S03: f32 = 5.1354652442e-07; /* 0x3509daa6 */
6363
const S04: f32 = 1.1661400734e-09; /* 0x30a045e8 */
6464

6565
/// Zeroth order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the first kind (f32).
66+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6667
pub fn j0f(mut x: f32) -> f32 {
6768
let z: f32;
6869
let r: f32;
@@ -109,6 +110,7 @@ const V03: f32 = 2.5915085189e-07; /* 0x348b216c */
109110
const V04: f32 = 4.4111031494e-10; /* 0x2ff280c2 */
110111

111112
/// Zeroth order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f32).
113+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
112114
pub fn y0f(x: f32) -> f32 {
113115
let z: f32;
114116
let u: f32;

libm/src/math/j1.rs

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ const S04: f64 = 5.04636257076217042715e-09; /* 0x3E35AC88, 0xC97DFF2C */
114114
const S05: f64 = 1.23542274426137913908e-11; /* 0x3DAB2ACF, 0xCFB97ED8 */
115115

116116
/// First order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the first kind (f64).
117+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
117118
pub fn j1(x: f64) -> f64 {
118119
let mut z: f64;
119120
let r: f64;
@@ -160,6 +161,7 @@ const V0: [f64; 5] = [
160161
];
161162

162163
/// First order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f64).
164+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
163165
pub fn y1(x: f64) -> f64 {
164166
let z: f64;
165167
let u: f64;

libm/src/math/j1f.rs

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const S04: f32 = 5.0463624390e-09; /* 0x31ad6446 */
6464
const S05: f32 = 1.2354227016e-11; /* 0x2d59567e */
6565

6666
/// First order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the first kind (f32).
67+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6768
pub fn j1f(x: f32) -> f32 {
6869
let mut z: f32;
6970
let r: f32;
@@ -109,6 +110,7 @@ const V0: [f32; 5] = [
109110
];
110111

111112
/// First order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f32).
113+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
112114
pub fn y1f(x: f32) -> f32 {
113115
let z: f32;
114116
let u: f32;

libm/src/math/jn.rs

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use super::{cos, fabs, get_high_word, get_low_word, j0, j1, log, sin, sqrt, y0,
3939
const INVSQRTPI: f64 = 5.64189583547756279280e-01; /* 0x3FE20DD7, 0x50429B6D */
4040

4141
/// Integer order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the first kind (f64).
42+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
4243
pub fn jn(n: i32, mut x: f64) -> f64 {
4344
let mut ix: u32;
4445
let lx: u32;
@@ -248,6 +249,7 @@ pub fn jn(n: i32, mut x: f64) -> f64 {
248249
}
249250

250251
/// Integer order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f64).
252+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
251253
pub fn yn(n: i32, x: f64) -> f64 {
252254
let mut ix: u32;
253255
let lx: u32;

libm/src/math/jnf.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use super::{fabsf, j0f, j1f, logf, y0f, y1f};
1717

1818
/// Integer order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the first kind (f32).
19+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
1920
pub fn jnf(n: i32, mut x: f32) -> f32 {
2021
let mut ix: u32;
2122
let mut nm1: i32;
@@ -191,6 +192,7 @@ pub fn jnf(n: i32, mut x: f32) -> f32 {
191192
}
192193

193194
/// Integer order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f32).
195+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
194196
pub fn ynf(n: i32, x: f32) -> f32 {
195197
let mut ix: u32;
196198
let mut ib: u32;

libm/src/math/modf.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
12
pub fn modf(x: f64) -> (f64, f64) {
23
let rv2: f64;
34
let mut u = x.to_bits();

libm/src/math/modff.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
12
pub fn modff(x: f32) -> (f32, f32) {
23
let rv2: f32;
34
let mut u: u32 = x.to_bits();

0 commit comments

Comments
 (0)