8000 Add basic docstrings to some functions by JSorngard · Pull Request #337 · rust-lang/libm · GitHub
[go: up one dir, main page]

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

Add basic docstrings to some functions #337

Merged
merged 12 commits into from
Oct 28, 2024
Merged
Prev Previous commit
Next Next commit
cargo fmt
  • Loading branch information
JSorngard committed Oct 28, 2024
commit 3feda3ac2b4710055b116247efd50d8a3b41a54b
2 changes: 1 addition & 1 deletion src/math/cos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use super::{k_cos, k_sin, rem_pio2};
//

/// The cosine of `x` (f64).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn cos(x: f64) -> f64 {
Expand Down
2 changes: 1 addition & 1 deletion src/math/cosf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const C3_PIO2: f64 = 3. * FRAC_PI_2; /* 0x4012D97C, 0x7F3321D2 */
const C4_PIO2: f64 = 4. * FRAC_PI_2; /* 0x401921FB, 0x54442D18 */

/// The cosine of `x` (f32).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn cosf(x: f32) -> f32 {
Expand Down
1 change: 0 additions & 1 deletion src/math/j1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ const V0: [f64; 5] = [
1.66559246207992079114e-11, /* 0x3DB25039, 0xDACA772A */
];


/// First order of the Bessel function of the second kind (f64).
pub fn y1(x: f64) -> f64 {
let z: f64;
Expand Down
2 changes: 0 additions & 2 deletions src/math/j1f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const S03: f32 = 1.1771846857e-06; /* 0x359dffc2 */
const S04: f32 = 5.0463624390e-09; /* 0x31ad6446 */
const S05: f32 = 1.2354227016e-11; /* 0x2d59567e */


/// First order of the Bessel function of the first kind (f32).
pub fn j1f(x: f32) -> f32 {
let mut z: f32;
Expand Down Expand Up @@ -109,7 +108,6 @@ const V0: [f32; 5] = [
1.6655924903e-11, /* 0x2d9281cf */
];


/// First order of the Bessel function of the second kind (f32).
pub fn y1f(x: f32) -> f32 {
let z: f32;
Expand Down
2 changes: 1 addition & 1 deletion src/math/sin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use super::{k_cos, k_sin, rem_pio2};
// TRIG(x) returns trig(x) nearly rounded

/// The sine of `x` (f64).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn sin(x: f64) -> f64 {
Expand Down
2 changes: 1 addition & 1 deletion src/math/sincos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use super::{get_high_word, k_cos, k_sin, rem_pio2};

/// Both the sine and cosine of `x` (f64).
///
///
/// `x` is specified in radians and the return value is (sin(x), cos(x)).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn sincos(x: f64) -> (f64, f64) {
Expand Down
2 changes: 1 addition & 1 deletion src/math/sincosf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const S3PIO2: f32 = 3.0 * PI_2; /* 0x4012D97C, 0x7F3321D2 */
const S4PIO2: f32 = 4.0 * PI_2; /* 0x401921FB, 0x54442D18 */

/// Both the sine and cosine of `x` (f32).
///
///
/// `x` is specified in radians and the return value is (sin(x), cos(x)).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn sincosf(x: f32) -> (f32, f32) {
Expand Down
2 changes: 1 addition & 1 deletion src/math/sinf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const S3_PIO2: f64 = 3. * FRAC_PI_2; /* 0x4012D97C, 0x7F3321D2 */
const S4_PIO2: f64 = 4. * FRAC_PI_2; /* 0x401921FB, 0x54442D18 */

/// The sine of `x` (f32).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn sinf(x: f32) -> f32 {
Expand Down
2 changes: 1 addition & 1 deletion src/math/sqrtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* ====================================================
*/

/// The square root of `x` (f32).
/// The square root of `x` (f32).
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn sqrtf(x: f32) -> f32 {
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
Expand Down
2 changes: 1 addition & 1 deletion src/math/tan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use super::{k_tan, rem_pio2};
// TRIG(x) returns trig(x) nearly rounded

/// The tangent of `x` (f64).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn tan(x: f64) -> f64 {
Expand Down
2 changes: 1 addition & 1 deletion src/math/tanf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const T3_PIO2: f64 = 3. * FRAC_PI_2; /* 0x4012D97C, 0x7F3321D2 */
const T4_PIO2: f64 = 4. * FRAC_PI_2; /* 0x401921FB, 0x54442D18 */

/// The tangent of `x` (f32).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn tanf(x: f32) -> f32 {
Expand Down
2 changes: 1 addition & 1 deletion src/math/tanh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::expm1;
*/

/// The hyperbolic tangent of `x` (f64).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn tanh(mut x: f64) -> f64 {
Expand Down
2 changes: 1 addition & 1 deletion src/math/tanhf.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::expm1f;

/// The hyperbolic tangent of `x` (f32).
///
///
/// `x` is specified in radians.
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn tanhf(mut x: f32) -> f32 {
Expand Down
0