mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -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();
|
||||
// Fill mantissa vector with zeros
|
||||
num.mant.insert(num.mant.end(), size - 1, 0);
|
||||
num.mant.insert(num.mant.end(), size, 0);
|
||||
return( num );
|
||||
}
|
||||
|
||||
|
|
|
@ -56,11 +56,11 @@ typedef enum eANGLE_TYPE ANGLE_TYPE;
|
|||
|
||||
typedef struct _number
|
||||
{
|
||||
int32_t sign; // The sign of the mantissa, +1, or -1
|
||||
int32_t cdigit; // The number of digits, or what passes for digits in the
|
||||
// radix being used.
|
||||
int32_t exp; // The offset of digits from the radix point
|
||||
// (decimal point in radix 10)
|
||||
int32_t sign = 1; // The sign of the mantissa, +1, or -1
|
||||
int32_t cdigit = 0; // The number of digits, or what passes for digits in the
|
||||
// radix being used.
|
||||
int32_t exp = 0; // The offset of digits from the radix point
|
||||
// (decimal point in radix 10)
|
||||
std::vector<MANTTYPE> mant;
|
||||
} NUMBER;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue