if (type & LEFT)
type &= ~ZEROPAD;
if (base < 2 || base > 36)
- return 0;
+ return false;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (base < 2 || base > 36)
return 0;
c = (type & ZEROPAD) ? L'0' : L' ';
- sign = 0;
+ sign = false;
if (type & SIGN) {
if (num < 0) {
sign = L'-';
if ( exp_sign == 'g' || exp_sign == 'G' ) {
type |= ZEROTRUNC;
if ( exponent < -4 || fabs(exponent) >= precision )
- exp_sign -= 2; // g -> e and G -> E
+ exp_sign -= 2; // g -> e and G -> E
+ else
+ exp_sign = 'f';
}
if ( exp_sign == 'e' || exp_sign == 'E' ) {
{
type |= ZEROTRUNC;
if ( exponent < -4 || fabs(exponent) >= precision )
- exp_sign -= 2; // g -> e and G -> E
+ exp_sign -= 2; // g -> e and G -> E
+ else
+ exp_sign = L'f';
}
if ( exp_sign == L'e' || exp_sign == L'E' )
if ( exp_sign == 'g' || exp_sign == 'G' ) {
type |= ZEROTRUNC;
if ( exponent < -4 || fabs(exponent) >= precision )
- exp_sign -= 2; // g -> e and G -> E
+ exp_sign -= 2; // g -> e and G -> E
+ else
+ exp_sign = 'f';
}
if ( exp_sign == 'e' || exp_sign == 'E' ) {
{
while ( intr > 0.0 )
{
- p=intr;
+ p=intr;
intr/=10.0L;
modfl(intr, &intr);
if ( exp_sign == L'g' || exp_sign == L'G' ) {
type |= ZEROTRUNC;
if ( exponent < -4 || fabs(exponent) >= precision )
- exp_sign -= 2; // g -> e and G -> E
+ exp_sign -= 2; // g -> e and G -> E
+ else
+ exp_sign = 'f';
}
if ( exp_sign == L'e' || exp_sign == L'E' ) {