Ensure all public functions are marked no_panic
Fixes: https://github.com/rust-lang/libm/issues/201
This commit is contained in:
parent
2db05de8fd
commit
8da1290f04
9 changed files with 15 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue