;ELC ;;; compiled by jimb@geech.gnu.ai.mit.edu on Mon Jul 5 23:04:20 1993 ;;; from file /gd/gnu/emacs/19.0/lisp/float.el ;;; emacs version 19.15.16. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19")) (defconst exp-base 2 "\ Base of exponent in this floating point representation.") (defconst mantissa-bits 24 "\ Number of significant bits in this floating point representation.") (defconst decimal-digits 6 "\ Number of decimal digits expected to be accurate.") (defconst expt-digits 2 "\ Maximum permitted digits in a scientific notation exponent.") (defconst maxbit (1- mantissa-bits) "\ Number of highest bit") (defconst mantissa-maxval (byte-code "\n\"S" [ash 1 maxbit] 3) "\ Maximum permissible value of mantissa") (defconst mantissa-minval (ash 1 maxbit) "\ Minimum permissible value of mantissa") (defconst floating-point-regexp "^[ ]*\\(-?\\)\\([0-9]*\\)\\(\\.\\([0-9]*\\)\\|\\)\\(\\(\\([Ee]\\)\\(-?\\)\\([0-9][0-9]*\\)\\)\\|\\)[ ]*$" "\ Regular expression to match floating point numbers. Extract matches: 1 - minus sign 2 - integer part 4 - fractional part 8 - minus sign for power of ten 9 - power of ten ") (defconst high-bit-mask (ash 1 maxbit) "\ Masks all bits except the high-order (sign) bit.") (defconst second-bit-mask (byte-code "\nS\"" [ash 1 maxbit] 3) "\ Masks all bits except the highest-order magnitude bit") (byte-code " T \"\nI\nI\nI\nI\nI\nI\n SH\n H\"\"\"\"\"\"\"\")̥**\"S,,!.*̥\"/\"\"" [(0 . 1) _f0 (4194304 . -23) _f1/2 (4194304 . -22) _f1 (5242880 . -19) _f10 make-vector decimal-digits powers-of-10 1 2 (6553600 . -16) 3 (8192000 . -13) 4 (5120000 . -9) 5 (6400000 . -6) 6 (8000000 . -3) all-decimal-digs-minval highest-power-of-10 defalias fashl #[(fnum) " @\" ASB" [ash fnum 1] 3] fashr #[(fnum) " @\" ATB" [ash fnum -1] 3] normalize #[(fnum) "@V@ \"U3!@W0@ \"U3!" [fnum 0 logand second-bit-mask fashl high-bit-mask _f0] 3] abs #[(n) "Y[" [n 0] 2] fabs #[(fnum) " @Y\n\n[) AB!" [normalize fnum n 0] 4] xor #[(a b) "  ?" [a b] 1] same-sign #[(a b) "\n@! @!\"?" [xor natnump a b] 4] extract-match #[(str i) "" [nil (byte-code " O" [str i] 3) ((error ""))] 3] mantissa-bits halfword-bits ash masklo lognot maskhi round-limit hihalf #[(n) "\n \" [\"" [ash logand n maskhi halfword-bits] 4] lohalf #[(n) " \n\"" [logand n masklo] 3]] 5) (defalias 'f+ #[(a1 a2) " \n\" \n\" \n\" ! ! @ @ A AZ\"\\ AB!*" [fmax a1 a2 fmin f2 f1 same-sign fashr normalize ash] 6 "\ Returns the sum of two floating point numbers."]) (defalias 'f- #[(a1 &optional a2) " \n!\"\n@[\nAB!" [a2 f+ a1 f- normalize] 4 "\ Returns the difference of two floating point numbers."]) (defalias 'f* #[(a1 a2) " !@ !@ \"?\n! !_!\n! !_!ȉ\n! !_!\\\\ \n! !_lj\n! !_!\n! !_! !\\\\\\\n ! Va\nT\nm\n[o\n !A !A \\\\B!-" [fabs a1 i1 a2 i2 same-sign sign hihalf lohalf prodlo prodhi round-limit normalize mantissa-bits] 6 "\ Returns the product of two floating point numbers."]) (defalias 'f/ #[(a1 a2) "@U E\"S !@!@ \"? \n    !c \nZWE \" T \"T  \nZ  \"  S * o [q !A!AZSZB!-" [a2 0 signal arith-error "attempt to divide by zero" a1 maxbit fabs same-sign sign divisor dividend quotient bits natnump ash 1 normalize] 7 "\ Returns the quotient of two floating point numbers."]) (defalias 'f% #[(a1 a2) " \"! \"\"" [f- a1 f* ftrunc f/ a2] 7 "\ Returns the remainder of first floating point number divided by second."]) (defalias 'f= #[(a1 a2) " " [a1 a2] 2 "\ Returns t if two floating point numbers are equal, nil otherwise."]) (defalias 'f> #[(a1 a2) " @!\n@Wć @V \n@X ć @X0\n@!0Ň A\nAU> A\nAV @\n@V" [natnump a1 a2 0 t nil] 2 "\ Returns t if first floating point number is greater than second, nil otherwise."]) (defalias 'f>= #[(a1 a2) " \n\" \n\"" [f> a1 a2 f=] 3 "\ Returns t if first floating point number is greater than or equal to second, nil otherwise."]) (defalias 'f< #[(a1 a2) " \n\"?" [f>= a1 a2] 3 "\ Returns t if first floating point number is less than second, nil otherwise."]) (defalias 'f<= #[(a1 a2) " \n\"?" [f> a1 a2] 3 "\ Returns t if first floating point number is less than or equal to second, nil otherwise."]) (defalias 'f/= #[(a1 a2) " \n\"?" [f= a1 a2] 3 "\ Returns t if first floating point number is not equal to second, nil otherwise."]) (defalias 'fmin #[(a1 a2) " \n\" \n" [f< a1 a2] 3 "\ Returns the minimum of two floating point numbers."]) (defalias 'fmax #[(a1 a2) " \n\" \n" [f> a1 a2] 3 "\ Returns the maximum of two floating point numbers."]) (defalias 'fzerop #[(fnum) "@U" [fnum 0] 2 "\ Returns t if the floating point number is zero, nil otherwise."]) (defalias 'floatp #[(fnum) ":@A" [fnum] 1 "\ Returns t if the arg is a floating point number, nil otherwise."]) (defalias 'f #[(int) " B!" [normalize int 0] 3 "\ Convert the integer argument to floating point, like a C cast operator."]) (defalias 'int-to-hex-string #[(int) "X# \n \"\"H!P \\ +" [-20 "0x" "0123456789ABCDEF" hex-chars str shiftval 0 char-to-string logand lsh int 15 4] 8 "\ Convert the integer argument to a C-style hexadecimal string."]) (defalias 'ftrunc #[(fnum) " A! A\n[XÇ @ A !+lj \" [\"5lj [ \" [\"[ B!*" [natnump fnum maxbit (0 . 1) exp mant normalize ash] 5 "\ Truncate the fractional part of a floating point number."]) (defalias 'fint #[(fnum) " !@\nA Y% [X!% \"+" [ftrunc fnum tf tint texp mantissa-bits mantissa-maxval mantissa-minval ash] 4 "\ Convert the floating point number to integer, with truncation, like a C cast operator."]) (defalias 'float-to-string #[(fnum &optional sci) " ! @W \n  \"$΂Z\n\n\"` \" \n\"G  \\, \" \n\"  TG \" \n\"{  Z` \n\" \" S{\n \"\"\n!\n\"\"!T!!Y T) OO !M SY Z$$!P$S$)M W= [Z$$!3P$S$P)M TO TOQ XPZ." [fabs fnum value 0 sign power result "" str temp _f1 pow10 f= _f0 "0" f>= f<= f* highest-power-of-10 decimal-digits _f10 f> f/ all-decimal-digs-minval ftrunc nil int f- _f1/2 fint int-to-string 1000000 sci 1 "." "E" zeroes natnump 2 "0." "-"] 6 "\ Convert the floating point number to a decimal string. Optional second argument non-nil means use scientific notation."]) (defalias 'string-to-float #[(str) " \n#\n\" \n\"   P \n\"Κ GZ GWO HUOT5 Z O GVx HY O  GZ\\ !͂\\ׂ_!.\n\"\n\"Κ !\"G^O!ׂ_ \\W[!V ! $\" S! %H\".\")&" [string-match floating-point-regexp str 0 nil power f* extract-match 2 int-subst 4 fract-subst digit-string 1 "-" mant-sign leading-0s round-up decimal-digits 48 53 f string-to-int -1 9 expt-subst 8 expt-sign expt chunks tens _f1 exponent func expt-digits f/ highest-power-of-10 powers-of-10 _f0] 8 "\ Convert the string to a floating point number. Accepts a decimal string in scientific notation, with exponent preceded by either E or e. Only the six most significant digits of the integer and fractional parts are used; only the first two digits of the exponent are used. Negative signs preceding both the decimal number and the exponent are recognized."]) (provide (quote float))