This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,29 @@ macro_rules! impl_op_for_ty {
277277 }
278278 }
279279
280+ impl MpOp for crate :: op:: [ <ilogb $suffix>] :: Routine {
281+ type MpTy = MpFloat ;
282+
283+ fn new_mp( ) -> Self :: MpTy {
284+ new_mpfloat:: <Self :: FTy >( )
285+ }
286+
287+ fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
288+ this. assign( input. 0 ) ;
289+
290+ // `get_exp` follows `frexp` for `0.5 <= |m| < 1.0`. Adjust the exponent by
291+ // one to scale the significand to `1.0 <= |m| < 2.0`.
292+ this. get_exp( ) . map( |v| v - 1 ) . unwrap_or_else( || {
293+ if this. is_infinite( ) {
294+ i32 :: MAX
295+ } else {
296+ // Zero or NaN
297+ i32 :: MIN
298+ }
299+ } )
300+ }
301+ }
302+
280303 impl MpOp for crate :: op:: [ <jn $suffix>] :: Routine {
281304 type MpTy = MpFloat ;
282305
Original file line number Diff line number Diff line change @@ -51,8 +51,6 @@ libm_macros::for_each_function! {
5151 ] ,
5252 skip: [
5353 // FIXME: MPFR tests needed
54- ilogb,
55- ilogbf,
5654 remquo,
5755 remquof,
5856
@@ -150,9 +148,5 @@ libm_macros::for_each_function! {
150148 scalbnf,
151149 yn,
152150 ynf,
153-
154- // FIXME: MPFR tests needed
155- ilogb,
156- ilogbf,
157151 ] ,
158152}
You can’t perform that action at this time.
0 commit comments