/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include "precomp.h"
-
-int _isnanl(double x);
-int _isinfl(double x);
-int _isnan(double x);
-int _isinf(double x);
-
+#include <precomp.h>
int
__vfwprintf(FILE *fp, const wchar_t *fmt0, va_list argp);
* Appropiated for the reactos kernel, March 1998 -- David Welch
*/
-#include <ctype.h>
#include <math.h>
#include <internal/ieee.h>
} n;
n.__n = &__n;
+
+ if ( exp_sign == L'g' || exp_sign == L'G' || exp_sign == L'e' || exp_sign == L'E' )
+ {
+ if ( 0 == n.n->mantissal && 0 == n.n->mantissah && 0 == n.n->exponent )
+ {
+ ie = 0;
+ }
+ else
+ {
+ ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff);
+ }
+
+ exponent = ie/3.321928;
+ }
- if ( exp_sign == L'g' || exp_sign == L'G' || exp_sign == L'e' || exp_sign == L'E' ) {
- ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff);
- exponent = ie/3.321928;
- }
if ( exp_sign == L'g' || exp_sign == L'G' ) {
type |= ZEROTRUNC;
tmp = buf;
if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) ) {
j = 0;
- while ( j < i && ( *tmp == L'0' || *tmp == L'.' )) {
+ while ( j < i && *tmp == L'0' ) {
+ tmp++;
+ i--;
+ }
+ if ( j < i && *tmp == L'.' ) {
tmp++;
i--;
}