Changeset 8181f5 in git for libpolys/coeffs/longrat.cc
- Timestamp:
- Sep 7, 2012, 2:07:49 PM (12 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 6dffa9e5b66ac5a81df2b68ff1c38dafc918b1f9
- Parents:
- f284db60abd29db5bed239271c0b6f6b1b680996
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-07 14:07:49+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-07 19:51:24+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/longrat.cc
rf284db r8181f5 69 69 #endif 70 70 71 /*-----------------------------------------------------------------*/ 72 /*3 73 * parameter s in number: 74 * 0 (or FALSE): not normalised rational 75 * 1 (or TRUE): normalised rational 76 * 3 : integer with n==NULL 77 */ 78 /*3 79 ** 'SR_INT' is the type of those integers small enough to fit into 29 bits. 80 ** Therefor the value range of this small integers is: $-2^{28}...2^{28}-1$. 81 ** 82 ** Small integers are represented by an immediate integer handle, containing 83 ** the value instead of pointing to it, which has the following form: 84 ** 85 ** +-------+-------+-------+-------+- - - -+-------+-------+-------+ 86 ** | guard | sign | bit | bit | | bit | tag | tag | 87 ** | bit | bit | 27 | 26 | | 0 | 0 | 1 | 88 ** +-------+-------+-------+-------+- - - -+-------+-------+-------+ 89 ** 90 ** Immediate integers handles carry the tag 'SR_INT', i.e. the last bit is 1. 91 ** This distuingishes immediate integers from other handles which point to 92 ** structures aligned on 4 byte boundaries and therefor have last bit zero. 93 ** (The second bit is reserved as tag to allow extensions of this scheme.) 94 ** Using immediates as pointers and dereferencing them gives address errors. 95 ** 96 ** To aid overflow check the most significant two bits must always be equal, 97 ** that is to say that the sign bit of immediate integers has a guard bit. 98 ** 99 ** The macros 'INT_TO_SR' and 'SR_TO_INT' should be used to convert between 100 ** a small integer value and its representation as immediate integer handle. 101 ** 102 ** Large integers and rationals are represented by z and n 103 ** where n may be undefined (if s==3) 104 ** NULL represents only deleted values 105 */ 106 #define SR_HDL(A) ((long)(A)) 71 //#define SR_HDL(A) ((long)(A)) 107 72 /*#define SR_INT 1L*/ 108 73 /*#define INT_TO_SR(INT) ((number) (((long)INT << 2) + SR_INT))*/
Note: See TracChangeset
for help on using the changeset viewer.