]>
git.proxmox.com Git - rustc.git/blob - vendor/packed_simd_2/src/api/math/float/ln.rs
1 //! Implements vertical (lane-wise) floating-point `ln`.
3 macro_rules
! impl_math_float_ln
{
4 ([$elem_ty
:ident
; $elem_count
:expr
]: $id
:ident
| $test_tt
:tt
) => {
6 /// Returns the natural logarithm of `self`.
8 pub fn ln(self) -> Self {
9 use crate::codegen
::math
::float
::ln
::Ln
;
17 pub mod [<$id _math_ln
>] {
19 #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
21 let z
= $id
::splat(0 as $elem_ty
);
22 let o
= $id
::splat(1 as $elem_ty
);
23 assert_eq
!(z
, o
.ln());
25 let e
= $id
::splat(crate::f64::consts
::E
as $elem_ty
);
26 let tol
= $id
::splat(2.4e-4 as $elem_ty
);
27 assert
!((o
- e
.ln()).abs().le(tol
).all());