VirtualBox

Changeset 96122 in vbox


Ignore:
Timestamp:
Aug 8, 2022 10:20:03 PM (2 years ago)
Author:
vboxsync
Message:

IPRT/nocrt: fmax, fmaxf and fmaxl. bugref:10261

Location:
trunk/src/VBox/Runtime
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r96120 r96122  
    18131813        common/math/copysignf.cpp \
    18141814        common/math/copysignl.cpp \
     1815        common/math/fmax.cpp \
     1816        common/math/fmaxf.cpp \
     1817        common/math/fmaxl.cpp \
    18151818        common/math/fmin.cpp \
    18161819        common/math/fminf.cpp \
  • trunk/src/VBox/Runtime/common/math/fmax.cpp

    r96120 r96122  
    11/* $Id$ */
    22/** @file
    3  * IPRT - No-CRT - fmin().
     3 * IPRT - No-CRT - fmax().
    44 */
    55
     
    3434
    3535
    36 #undef fmin
    37 double RT_NOCRT(fmin)(double rdLeft, double rdRight)
     36#undef fmax
     37double RT_NOCRT(fmax)(double rdLeft, double rdRight)
    3838{
    3939    if (!isnan(rdLeft))
     
    4444               the 0.0 test and signbit fun here. */
    4545            if (rdLeft != rdRight || rdLeft != 0.0)
    46                 return rdLeft <= rdRight ? rdLeft : rdRight;
    47             return signbit(rdLeft) >= signbit(rdRight) ? rdLeft : rdRight;
     46                return rdLeft >= rdRight ? rdLeft : rdRight;
     47            return signbit(rdLeft) <= signbit(rdRight) ? rdLeft : rdRight;
    4848        }
    4949        return rdLeft;
     
    5151    return rdRight;
    5252}
    53 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fmin);
     53RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fmax);
    5454
  • trunk/src/VBox/Runtime/common/math/fmaxf.cpp

    r96120 r96122  
    11/* $Id$ */
    22/** @file
    3  * IPRT - No-CRT - fminf().
     3 * IPRT - No-CRT - fmaxf().
    44 */
    55
     
    3434
    3535
    36 #undef fminf
    37 float RT_NOCRT(fminf)(float r32Left, float r32Right)
     36#undef fmaxf
     37float RT_NOCRT(fmaxf)(float r32Left, float r32Right)
    3838{
    3939    if (!isnan(r32Left))
     
    4444               the 0.0 test and signbit fun here. */
    4545            if (r32Left != r32Right || r32Left != 0.0)
    46                 return r32Left <= r32Right ? r32Left : r32Right;
    47             return signbit(r32Left) >= signbit(r32Right) ? r32Left : r32Right;
     46                return r32Left >= r32Right ? r32Left : r32Right;
     47            return signbit(r32Left) <= signbit(r32Right) ? r32Left : r32Right;
    4848        }
    4949        return r32Left;
     
    5151    return r32Right;
    5252}
    53 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fminf);
     53RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fmaxf);
    5454
  • trunk/src/VBox/Runtime/common/math/fmaxl.cpp

    r96120 r96122  
    11/* $Id$ */
    22/** @file
    3  * IPRT - No-CRT - fminl().
     3 * IPRT - No-CRT - fmaxl().
    44 */
    55
     
    3232#include "internal/nocrt.h"
    3333#include <iprt/nocrt/math.h>
    34 #include <iprt/nocrt/limits.h>
    3534
    3635
    37 #undef fminl
    38 long double RT_NOCRT(fminl)(long double  lrdLeft, long double lrdRight)
     36#undef fmaxl
     37long double RT_NOCRT(fmaxl)(long double  lrdLeft, long double lrdRight)
    3938{
    4039    if (!isnan(lrdLeft))
     
    4544               the 0.0 test and signbit fun here. */
    4645            if (lrdLeft != lrdRight || lrdLeft != 0.0)
    47                 return lrdLeft <= lrdRight ? lrdLeft : lrdRight;
    48             return signbit(lrdLeft) >= signbit(lrdRight) ? lrdLeft : lrdRight;
     46                return lrdLeft >= lrdRight ? lrdLeft : lrdRight;
     47            return signbit(lrdLeft) <= signbit(lrdRight) ? lrdLeft : lrdRight;
    4948        }
    5049        return lrdLeft;
     
    5251    return lrdRight;
    5352}
    54 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fminl);
     53RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fmaxl);
    5554
  • trunk/src/VBox/Runtime/common/math/fminl.cpp

    r96120 r96122  
    3232#include "internal/nocrt.h"
    3333#include <iprt/nocrt/math.h>
    34 #include <iprt/nocrt/limits.h>
    3534
    3635
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette