@@ -154,8 +154,12 @@ libm_macros::for_each_function! {
154154 fmodf,
155155 frexp,
156156 frexpf,
157+ frexpf128,
158+ frexpf16,
157159 ilogb,
158160 ilogbf,
161+ ilogbf128,
162+ ilogbf16,
159163 jn,
160164 jnf,
161165 ldexp,
@@ -315,48 +319,6 @@ macro_rules! impl_op_for_ty {
315319 }
316320 }
317321
318- impl MpOp for crate :: op:: [ <frexp $suffix>] :: Routine {
319- type MpTy = MpFloat ;
320-
321- fn new_mp( ) -> Self :: MpTy {
322- new_mpfloat:: <Self :: FTy >( )
323- }
324-
325- fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
326- // Implementation taken from `rug::Float::to_f32_exp`.
327- this. assign( input. 0 ) ;
328- let exp = this. get_exp( ) . unwrap_or( 0 ) ;
329- if exp != 0 {
330- * this >>= exp;
331- }
332-
333- ( prep_retval:: <Self :: FTy >( this, Ordering :: Equal ) , exp)
334- }
335- }
336-
337- impl MpOp for crate :: op:: [ <ilogb $suffix>] :: Routine {
338- type MpTy = MpFloat ;
339-
340- fn new_mp( ) -> Self :: MpTy {
341- new_mpfloat:: <Self :: FTy >( )
342- }
343-
344- fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
345- this. assign( input. 0 ) ;
346-
347- // `get_exp` follows `frexp` for `0.5 <= |m| < 1.0`. Adjust the exponent by
348- // one to scale the significand to `1.0 <= |m| < 2.0`.
349- this. get_exp( ) . map( |v| v - 1 ) . unwrap_or_else( || {
350- if this. is_infinite( ) {
351- i32 :: MAX
352- } else {
353- // Zero or NaN
354- i32 :: MIN
355- }
356- } )
357- }
358- }
359-
360322 impl MpOp for crate :: op:: [ <jn $suffix>] :: Routine {
361323 type MpTy = MpFloat ;
362324
@@ -480,6 +442,49 @@ macro_rules! impl_op_for_ty_all {
480442 prep_retval:: <Self :: RustRet >( & mut this. 0 , Ordering :: Equal )
481443 }
482444 }
445+
446+ impl MpOp for crate :: op:: [ <frexp $suffix>] :: Routine {
447+ type MpTy = MpFloat ;
448+
449+ fn new_mp( ) -> Self :: MpTy {
450+ new_mpfloat:: <Self :: FTy >( )
451+ }
452+
453+ fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
454+ // Implementation taken from `rug::Float::to_f32_exp`.
455+ this. assign( input. 0 ) ;
456+ let exp = this. get_exp( ) . unwrap_or( 0 ) ;
457+ if exp != 0 {
458+ * this >>= exp;
459+ }
460+
461+ ( prep_retval:: <Self :: FTy >( this, Ordering :: Equal ) , exp)
462+ }
463+ }
464+
465+ impl MpOp for crate :: op:: [ <ilogb $suffix>] :: Routine {
466+ type MpTy = MpFloat ;
467+
468+ fn new_mp( ) -> Self :: MpTy {
469+ new_mpfloat:: <Self :: FTy >( )
470+ }
471+
472+ fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
473+ this. assign( input. 0 ) ;
474+
475+ // `get_exp` follows `frexp` for `0.5 <= |m| < 1.0`. Adjust the exponent by
476+ // one to scale the significand to `1.0 <= |m| < 2.0`.
477+ this. get_exp( ) . map( |v| v - 1 ) . unwrap_or_else( || {
478+ if this. is_infinite( ) {
479+ i32 :: MAX
480+ } else {
481+ // Zero or NaN
482+ i32 :: MIN
483+ }
484+ } )
485+ }
486+ }
487+
483488 }
484489 } ;
485490}
0 commit comments