@@ -148,6 +148,14 @@ libm_macros::for_each_function! {
148148 floorf,
149149 floorf128,
150150 floorf16,
151+ fmaximum,
152+ fmaximumf,
153+ fmaximumf128,
154+ fmaximumf16,
155+ fminimum,
156+ fminimumf,
157+ fminimumf128,
158+ fminimumf16,
151159 fmod,
152160 fmodf,
153161 fmodf128,
@@ -197,8 +205,10 @@ libm_macros::for_each_function! {
197205 fabs | fabsf => abs,
198206 fdim | fdimf | fdimf16 | fdimf128 => positive_diff,
199207 fma | fmaf | fmaf128 => mul_add,
200- fmax | fmaxf | fmaxf16 | fmaxf128 => max,
201- fmin | fminf | fminf16 | fminf128 => min,
208+ fmax | fmaxf | fmaxf16 | fmaxf128 |
209+ fmaximum_num | fmaximum_numf | fmaximum_numf16 | fmaximum_numf128 => max,
210+ fmin | fminf | fminf16 | fminf128 |
211+ fminimum_num | fminimum_numf | fminimum_numf16 | fminimum_numf128 => min,
202212 lgamma | lgammaf => ln_gamma,
203213 log | logf => ln,
204214 log1p | log1pf => ln_1p,
@@ -446,6 +456,46 @@ macro_rules! impl_op_for_ty_all {
446456 }
447457 }
448458
459+ impl MpOp for crate :: op:: [ < fmaximum $suffix >] :: Routine {
460+ type MpTy = ( MpFloat , MpFloat ) ;
461+
462+ fn new_mp( ) -> Self :: MpTy {
463+ ( new_mpfloat:: <Self :: FTy >( ) , new_mpfloat:: <Self :: FTy >( ) )
464+ }
465+
466+ fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
467+ this. 0 . assign( input. 0 ) ;
468+ this. 1 . assign( input. 1 ) ;
469+ let ord = if this. 0 . is_nan( ) || this. 1 . is_nan( ) {
470+ this. 0 . assign( $fty:: NAN ) ;
471+ Ordering :: Equal
472+ } else {
473+ this. 0 . max_round( & this. 1 , Nearest )
474+ } ;
475+ prep_retval:: <Self :: RustRet >( & mut this. 0 , ord)
476+ }
477+ }
478+
479+ impl MpOp for crate :: op:: [ < fminimum $suffix >] :: Routine {
480+ type MpTy = ( MpFloat , MpFloat ) ;
481+
482+ fn new_mp( ) -> Self :: MpTy {
483+ ( new_mpfloat:: <Self :: FTy >( ) , new_mpfloat:: <Self :: FTy >( ) )
484+ }
485+
486+ fn run( this: & mut Self :: MpTy , input: Self :: RustArgs ) -> Self :: RustRet {
487+ this. 0 . assign( input. 0 ) ;
488+ this. 1 . assign( input. 1 ) ;
489+ let ord = if this. 0 . is_nan( ) || this. 1 . is_nan( ) {
490+ this. 0 . assign( $fty:: NAN ) ;
491+ Ordering :: Equal
492+ } else {
493+ this. 0 . min_round( & this. 1 , Nearest )
494+ } ;
495+ prep_retval:: <Self :: RustRet >( & mut this. 0 , ord)
496+ }
497+ }
498+
449499 // `ldexp` and `scalbn` are the same for binary floating point, so just forward all
450500 // methods.
451501 impl MpOp for crate :: op:: [ <ldexp $suffix>] :: Routine {
0 commit comments