mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Iterate over the mantissa vector directly in zernum(PNUMBER)
This commit is contained in:
parent
a4522ae0fe
commit
e297e82fb2
1 changed files with 2 additions and 7 deletions
|
@ -635,16 +635,11 @@ bool lessnum( PNUMBER a, PNUMBER b )
|
||||||
bool zernum( PNUMBER a )
|
bool zernum( PNUMBER a )
|
||||||
|
|
||||||
{
|
{
|
||||||
int32_t length;
|
|
||||||
vector<MANTTYPE>::iterator pcha;
|
|
||||||
length = a->cdigit;
|
|
||||||
pcha = a->mant.begin();
|
|
||||||
|
|
||||||
// loop over all the digits until you find a nonzero or until you run
|
// loop over all the digits until you find a nonzero or until you run
|
||||||
// out of digits
|
// out of digits
|
||||||
while ( length-- > 0 )
|
for ( MANTTYPE digit : a->mant )
|
||||||
{
|
{
|
||||||
if ( *pcha++ )
|
if ( digit )
|
||||||
{
|
{
|
||||||
// One of the digits isn't zero, therefore the number isn't zero
|
// One of the digits isn't zero, therefore the number isn't zero
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue