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 {
277
277
}
278
278
}
279
279
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
+
280
303
impl MpOp for crate :: op:: [ <jn $suffix>] :: Routine {
281
304
type MpTy = MpFloat ;
282
305
Original file line number Diff line number Diff line change @@ -51,8 +51,6 @@ libm_macros::for_each_function! {
51
51
] ,
52
52
skip: [
53
53
// FIXME: MPFR tests needed
54
- ilogb,
55
- ilogbf,
56
54
remquo,
57
55
remquof,
58
56
@@ -150,9 +148,5 @@ libm_macros::for_each_function! {
150
148
scalbnf,
151
149
yn,
152
150
ynf,
153
-
154
- // FIXME: MPFR tests needed
155
- ilogb,
156
- ilogbf,
157
151
] ,
158
152
}
You can’t perform that action at this time.
0 commit comments