Add comments

This commit is contained in:
Rudy Huyn 2019-03-31 16:59:30 -07:00
commit c546c13d0b
3 changed files with 6 additions and 11 deletions

View file

@ -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);
}

View file

@ -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;

View file

@ -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;