VirtualBox

Changeset 94302 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 17, 2022 9:11:51 PM (3 years ago)
Author:
vboxsync
Message:

IPRT: Added RTStrFormatR64 and RTStrFormatR32 and split out the floating point formatting from strformatnum.cpp. [fixes] bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/strformatfloat.cpp

    r94300 r94302  
    251251        fDenormal = true;
    252252    }
    253     else if (uExponent == RTFLOAT64U_EXP_MAX)
     253    else if (uExponent == RTFLOAT80U_EXP_MAX)
    254254    {
    255255        if (!fInteger)
     
    285285            pszTmp = (char *)memcpy(pszTmp, "QNan[", 5) + 5;
    286286        }
    287         pszTmp += RTStrFormatNumber(pszTmp, uFraction, 16, 2 + RTFLOAT64U_FRACTION_BITS / 4, 0,
     287        pszTmp += RTStrFormatNumber(pszTmp, uFraction, 16, 2 + RTFLOAT80U_FRACTION_BITS / 4, 0,
    288288                                    RTSTR_F_SPECIAL | RTSTR_F_ZEROPAD | RTSTR_F_64BIT);
    289289        *pszTmp++ = ']';
     
    296296    *pszTmp++ = fInteger ? '1' : '0';
    297297    *pszTmp++ = 'm';
    298     pszTmp += RTStrFormatNumber(pszTmp, uFraction, 16, 2 + RTFLOAT64U_FRACTION_BITS / 4, 0,
     298    pszTmp += RTStrFormatNumber(pszTmp, uFraction, 16, 2 + RTFLOAT80U_FRACTION_BITS / 4, 0,
    299299                                RTSTR_F_SPECIAL | RTSTR_F_ZEROPAD | RTSTR_F_64BIT);
    300300
    301301    *pszTmp++ = '^';
    302     pszTmp += RTStrFormatNumber(pszTmp, (int32_t)uExponent - RTFLOAT64U_EXP_BIAS, 10, 0, 0,
     302    pszTmp += RTStrFormatNumber(pszTmp, (int32_t)uExponent - RTFLOAT80U_EXP_BIAS, 10, 0, 0,
    303303                                RTSTR_F_ZEROPAD | RTSTR_F_32BIT | RTSTR_F_VALSIGNED);
    304304    if (fDenormal && (fFlags & RTSTR_F_SPECIAL))
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