Default-initialize number members and fix mantissa size

This commit is contained in:
fwcd 2019-04-11 02:55:25 +02:00
commit 420d48cc0b
2 changed files with 6 additions and 6 deletions

View file

@ -185,7 +185,7 @@ NUMBER _createnum( _In_ uint32_t size )
{ {
NUMBER num = NUMBER(); NUMBER num = NUMBER();
// Fill mantissa vector with zeros // Fill mantissa vector with zeros
num.mant.insert(num.mant.end(), size - 1, 0); num.mant.insert(num.mant.end(), size, 0);
return( num ); return( num );
} }

View file

@ -56,11 +56,11 @@ typedef enum eANGLE_TYPE ANGLE_TYPE;
typedef struct _number typedef struct _number
{ {
int32_t sign; // The sign of the mantissa, +1, or -1 int32_t sign = 1; // The sign of the mantissa, +1, or -1
int32_t cdigit; // The number of digits, or what passes for digits in the int32_t cdigit = 0; // The number of digits, or what passes for digits in the
// radix being used. // radix being used.
int32_t exp; // The offset of digits from the radix point int32_t exp = 0; // The offset of digits from the radix point
// (decimal point in radix 10) // (decimal point in radix 10)
std::vector<MANTTYPE> mant; std::vector<MANTTYPE> mant;
} NUMBER; } NUMBER;