Изменил(а) на 'cv3/program.c'
This commit is contained in:
parent
e6c2f23cc6
commit
3abd673a7d
@ -42,8 +42,10 @@ bool calculatorLogic(char buffer[SIZE][SIZE]){
|
|||||||
temporaryDecimal = round((atof(buffer[currentlyInBuffer-2]) * atof(buffer[currentlyInBuffer-1]))*100)/100;
|
temporaryDecimal = round((atof(buffer[currentlyInBuffer-2]) * atof(buffer[currentlyInBuffer-1]))*100)/100;
|
||||||
break;
|
break;
|
||||||
case '/':
|
case '/':
|
||||||
if(atof(buffer[currentlyInBuffer-1]) == 0.0)
|
if(atof(buffer[currentlyInBuffer-1]) == 0.0) {
|
||||||
printf("division by zero\n");
|
printf("division by zero\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
temporaryDecimal = round((atof(buffer[currentlyInBuffer-2]) / atof(buffer[currentlyInBuffer-1]))*100)/100;
|
temporaryDecimal = round((atof(buffer[currentlyInBuffer-2]) / atof(buffer[currentlyInBuffer-1]))*100)/100;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user