Changeset 40971d in git for libpolys/coeffs/modulop.h


Ignore:
Timestamp:
Nov 22, 2013, 11:58:33 AM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
0615d9680ee7c46dfdc3c107760b2f351a130c31
Parents:
fc34c44ed7973f5f200362cfa8f150bc31c8387b
Message:
chg: simplified npNegM
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/modulop.h

    rfc34c4 r40971d  
    125125                       r->ch-(long)b+(long)a : (long)a-(long)b);
    126126}
    127 
    128 static inline number npNegM(number a, const coeffs r)
    129 {
    130   return (number)((long)(r->ch)-(long)(a));
    131 }
    132 
    133127#else
    134128static inline number npAddM(number a, number b, const coeffs r)
     
    153147   return (number)res;
    154148}
     149#endif
    155150
    156 
    157 static inline number npNegM(number b, const coeffs r)
     151static inline number npNegM(number a, const coeffs r)
    158152{
    159    long res =  - (long)b;
    160 #if SIZEOF_LONG == 8
    161    res += (res >> 63) & r->ch;
    162 #else
    163    res += (res >> 31) & r->ch;
    164 #endif
    165    return (number)res;
     153  return (number)((long)(r->ch)-(long)(a));
    166154}
    167 
    168 #endif
    169155
    170156static inline BOOLEAN npIsZeroM (number  a, const coeffs)
Note: See TracChangeset for help on using the changeset viewer.