XEROX TRUEHAX 2 4 1 TrueHax 1 4 By: Henry Thompson (HThompson.pa@Xerox.com) INTRODUCTION TrueHax is a small package providing for true and correct manipulation of numbers with arbitrary radices, including negative ones. It provides for reading, printing, and constructing strings. FUNCTIONS (TrueRadixRead radix file readtable) [Function] Reads a positive or negative number (indicated by '-'), possibly preceded by some number of SEPRCHARs, from file using radix and readtable. Use A for 10, B for 11, ... for radices greater than 10. Prefixing a number in a negative base with a '-' will invert it, rather than guaranteeing a negative result. (TrueRadixPrint number radix file) [Function] Prints the number on the file in the radix, preceded by a '-' if the number is negative and the radix is positive. (TrueMod number modulus) [Function] Equivalent to IMOD unless both number and modulus are negative, in which case it gives the correct answer (which IMOD doesn't). (TRS number radix stringPointer) [Function] Returns a string with number in it per radix, via TrueRadixPrint. Re-uses stringPointer if given. Uses a fixed internal string, so copy the result if you want to hold on to it. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))1È È(È (È(ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEADMODERN MODERN MODERN MODERN MODERNLOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN - Á  4    O   [³Nzº