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

Ensure all public functions are marked no_panic #543

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/math/frexpf.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn frexpf(x: f32) -> (f32, i32) {
let mut y = x.to_bits();
let ee: i32 = ((y >> 23) & 0xff) as i32;
Expand Down
2 changes: 2 additions & 0 deletions src/math/j0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const S03: f64 = 5.13546550207318111446e-07; /* 0x3EA13B54, 0xCE84D5A9 */
const S04: f64 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */

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

/// Zeroth order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f64).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn y0(x: f64) -> f64 {
let z: f64;
let u: f64;
Expand Down
2 changes: 2 additions & 0 deletions src/math/j0f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const S03: f32 = 5.1354652442e-07; /* 0x3509daa6 */
const S04: f32 = 1.1661400734e-09; /* 0x30a045e8 */

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

/// Zeroth order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f32).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn y0f(x: f32) -> f32 {
let z: f32;
let u: f32;
Expand Down
2 changes: 2 additions & 0 deletions src/math/j1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const S04: f64 = 5.04636257076217042715e-09; /* 0x3E35AC88, 0xC97DFF2C */
const S05: f64 = 1.23542274426137913908e-11; /* 0x3DAB2ACF, 0xCFB97ED8 */

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

/// First order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f64).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn y1(x: f64) -> f64 {
let z: f64;
let u: f64;
Expand Down
2 changes: 2 additions & 0 deletions src/math/j1f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const S04: f32 = 5.0463624390e-09; /* 0x31ad6446 */
const S05: f32 = 1.2354227016e-11; /* 0x2d59567e */

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

/// First order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f32).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn y1f(x: f32) -> f32 {
let z: f32;
let u: f32;
Expand Down
2 changes: 2 additions & 0 deletions src/math/jn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use super::{cos, fabs, get_high_word, get_low_word, j0, j1, log, sin, sqrt, y0,
const INVSQRTPI: f64 = 5.64189583547756279280e-01; /* 0x3FE20DD7, 0x50429B6D */

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

/// Integer order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f64).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn yn(n: i32, x: f64) -> f64 {
let mut ix: u32;
let lx: u32;
Expand Down
2 changes: 2 additions & 0 deletions src/math/jnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use super::{fabsf, j0f, j1f, logf, y0f, y1f};

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

/// Integer order of the [Bessel function](https://en.wikipedia.org/wiki/Bessel_function) of the second kind (f32).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn ynf(n: i32, x: f32) -> f32 {
let mut ix: u32;
let mut ib: u32;
Expand Down
1 change: 1 addition & 0 deletions src/math/modf.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn modf(x: f64) -> (f64, f64) {
let rv2: f64;
let mut u = x.to_bits();
Expand Down
1 change: 1 addition & 0 deletions src/math/modff.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn modff(x: f32) -> (f32, f32) {
let rv2: f32;
let mut u: u32 = x.to_bits();
Expand Down