mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Default-initialize number members and fix mantissa size
This commit is contained in:
parent
97fa6aa387
commit
420d48cc0b
2 changed files with 6 additions and 6 deletions
|
@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,10 +56,10 @@ 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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue