@@ -9,7 +9,7 @@ use az::Az;
9
9
use rug:: Assign ;
10
10
pub use rug:: Float as MpFloat ;
11
11
use rug:: float:: Round :: Nearest ;
12
- use rug:: ops:: { PowAssignRound , RemAssignRound } ;
12
+ use rug:: ops:: { MulAssignRound , PowAssign , PowAssignRound , RemAssignRound } ;
13
13
14
14
use crate :: { Float , MathOp } ;
15
15
@@ -255,6 +255,36 @@ macro_rules! impl_op_for_ty {
255
255
}
256
256
}
257
257
258
+ // `ldexp` and `scalbn` are the same for binary floating point, so just forward all
259
+ // methods.
260
+ impl MpOp for crate :: op:: [ <ldexp $suffix>] :: Routine {
261
+ type MpTy = <crate :: op:: [ <scalbn $suffix>] :: Routine as MpOp >:: MpTy ;
262
+
263
+ fn new_mp( ) -> Self :: MpTy {
264
+ <crate :: op:: [ <scalbn $suffix>] :: Routine as MpOp >:: new_mp( )
265
+ }
266
+
267
+ fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
268
+ <crate :: op:: [ <scalbn $suffix>] :: Routine as MpOp >:: run( this, input)
269
+ }
270
+ }
271
+
272
+ impl MpOp for crate :: op:: [ <scalbn $suffix>] :: Routine {
273
+ type MpTy = ( MpFloat , MpFloat ) ;
274
+
275
+ fn new_mp( ) -> Self :: MpTy {
276
+ ( new_mpfloat:: <Self :: FTy >( ) , new_mpfloat:: <Self :: FTy >( ) )
277
+ }
278
+
279
+ fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
280
+ this. 0 . assign( input. 0 ) ;
281
+ this. 1 . assign( 2.0 ) ;
282
+ this. 1 . pow_assign( input. 1 ) ;
283
+ let ord = this. 0 . mul_assign_round( & this. 1 , Nearest ) ;
284
+ prep_retval:: <Self :: FTy >( & mut this. 0 , ord)
285
+ }
286
+ }
287
+
258
288
impl MpOp for crate :: op:: [ <sincos $suffix>] :: Routine {
259
289
type MpTy = ( MpFloat , MpFloat ) ;
260
290
0 commit comments