mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Add comments
This commit is contained in:
parent
4908efcb96
commit
c546c13d0b
3 changed files with 6 additions and 11 deletions
|
@ -114,12 +114,13 @@ CalcEngine::Rational CCalcEngine::DoOperation(int operation, CalcEngine::Rationa
|
|||
{
|
||||
if (m_fIntegerMode)
|
||||
{
|
||||
// Programmer mode
|
||||
// Programmer mode, use remrat (remainder after division)
|
||||
iFinalSign = iNumeratorSign;
|
||||
result %= temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
//other modes, use modrat (modulus after division)
|
||||
iFinalSign = iDenominatorSign;
|
||||
result = Mod(result, temp);
|
||||
}
|
||||
|
|
|
@ -92,11 +92,9 @@ void asinanglerat( _Inout_ PRAT *pa, ANGLE_TYPE angletype, uint32_t radix, int32
|
|||
void asinrat( PRAT *px, uint32_t radix, int32_t precision)
|
||||
|
||||
{
|
||||
int32_t sgn;
|
||||
PRAT pret= nullptr;
|
||||
PRAT phack= nullptr;
|
||||
|
||||
sgn = SIGN(*px);
|
||||
int32_t sgn = SIGN(*px);
|
||||
|
||||
(*px)->pp->sign = 1;
|
||||
(*px)->pq->sign = 1;
|
||||
|
@ -204,9 +202,7 @@ void _acosrat( PRAT *px, int32_t precision)
|
|||
void acosrat( PRAT *px, uint32_t radix, int32_t precision)
|
||||
|
||||
{
|
||||
int32_t sgn;
|
||||
|
||||
sgn = SIGN(*px);
|
||||
int32_t sgn = SIGN(*px);
|
||||
|
||||
(*px)->pp->sign = 1;
|
||||
(*px)->pq->sign = 1;
|
||||
|
@ -291,10 +287,8 @@ void _atanrat( PRAT *px, int32_t precision)
|
|||
void atanrat( PRAT *px, uint32_t radix, int32_t precision)
|
||||
|
||||
{
|
||||
int32_t sgn;
|
||||
PRAT tmpx= nullptr;
|
||||
|
||||
sgn = SIGN(*px);
|
||||
int32_t sgn = SIGN(*px);
|
||||
|
||||
(*px)->pp->sign = 1;
|
||||
(*px)->pq->sign = 1;
|
||||
|
|
|
@ -236,7 +236,7 @@ void remrat(PRAT *pa, PRAT b)
|
|||
|
||||
void modrat(PRAT *pa, PRAT b)
|
||||
{
|
||||
//contrary to remrat, modrat(a, 0) must return a
|
||||
//contrary to remrat(X, 0) returning 0, modrat(X, 0) must return X
|
||||
if (zerrat(b))
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue