;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Mon Apr 17 19:39:59 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/float.el ;;; emacs version 19.28.90.26. ;;; 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 "`/gd/gnu/emacs/19.0/lisp/float.el' was compiled for Emacs 19")) #@57 Base of exponent in this floating point representation. (defconst exp-base 2 (#$ . 479)) #@67 Number of significant bits in this floating point representation. (defconst mantissa-bits 24 (#$ . 574)) #@51 Number of decimal digits expected to be accurate. (defconst decimal-digits 6 (#$ . 685)) #@61 Maximum permitted digits in a scientific notation exponent. (defconst expt-digits 2 (#$ . 780)) #@23 Number of highest bit (defconst maxbit (1- mantissa-bits) (#$ . 882)) #@39 Maximum permissible value of mantissa (defconst mantissa-maxval (byte-code "\n\"S" [ash 1 maxbit] 3) (#$ . 958)) #@39 Minimum permissible value of mantissa (defconst mantissa-minval (ash 1 maxbit) (#$ . 1080)) #@173 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 floating-point-regexp "^[ ]*\\(-?\\)\\([0-9]*\\)\\(\\.\\([0-9]*\\)\\|\\)\\(\\(\\([Ee]\\)\\(-?\\)\\([0-9][0-9]*\\)\\)\\|\\)[ ]*$" (#$ . 1179)) #@50 Masks all bits except the high-order (sign) bit. (defconst high-bit-mask (ash 1 maxbit) (#$ . 1511)) #@55 Masks all bits except the highest-order magnitude bit (defconst second-bit-mask (byte-code "\nS\"" [ash 1 maxbit] 3) (#$ . 1618)) (byte-code " T \"\nI\nI\nI\nI\nI\nI\n SH\n Hȇ" [(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] 4) (defalias 'fashl #[(fnum) " @\" ASB" [ash fnum 1] 3]) (defalias 'fashr #[(fnum) " @\" ATB" [ash fnum -1] 3]) (defalias 'normalize #[(fnum) "@V@ \"U3!@W0@ \"U3!" [fnum 0 logand second-bit-mask fashl high-bit-mask _f0] 3]) (defalias 'abs #[(n) "Y[" [n 0] 2]) (defalias 'fabs #[(fnum) "\n@!\nAB!" [normalize abs fnum] 3]) (defalias 'xor #[(a b) "  ?" [a b] 1]) (defalias 'same-sign #[(a b) "\n@! @!\"?" [xor natnump a b] 4]) (defalias 'extract-match #[(str i) "" [nil (byte-code " O" [str i] 3) ((error ""))] 3]) (byte-code "\n\"S !\n\"" [mantissa-bits 2 halfword-bits ash 1 masklo lognot maskhi round-limit] 4) (defalias 'hihalf #[(n) "\n \"\f[\"" [ash logand n maskhi halfword-bits] 4]) (defalias 'lohalf #[(n) " \n\"" [logand n masklo] 3]) #@48 Returns the sum of two floating point numbers. (defalias 'f+ #[(a1 a2) " \n\" \n\" \n\" !\f! @\f@\fA AZ\"\\ AB!*" [fmax a1 a2 fmin f2 f1 same-sign fashr normalize ash] 6 (#$ . 2946)]) #@55 Returns the difference of two floating point numbers. (defalias 'f- #[(a1 &optional a2) " \n!\"\n@[\nAB!" [a2 f+ a1 f- normalize] 4 (#$ . 3151)]) #@52 Returns the product of two floating point numbers. (defalias 'f* #[(a1 a2) " !@ !@ \"?\n!\f!_!\n!\f!_!ȉ\n!\f!_!\\\\ \n!\f!_lj\n!\f!_!\n!\f!_! !\\\\\\\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 (#$ . 3312)]) #@53 Returns the quotient of two floating point numbers. (defalias 'f/ #[(a1 a2) "@U E\"S !@!@ \"? \n \f  !c \nZWE\f\"\fT\f\"T\f \nZ  \"  S * o\f[q\f !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 (#$ . 3662)]) #@73 Returns the remainder of first floating point number divided by second. (defalias 'f% #[(a1 a2) " \"! \"\"" [f- a1 f* ftrunc f/ a2] 7 (#$ . 4047)]) #@67 Returns t if two floating point numbers are equal, nil otherwise. (defalias 'f= #[(a1 a2) " " [a1 a2] 2 (#$ . 4208)]) #@81 Returns t if first floating point number is greater than second, 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 (#$ . 4335)]) #@94 Returns t if first floating point number is greater than or equal to second, nil otherwise. (defalias 'f>= #[(a1 a2) " \n\" \n\"" [f> a1 a2 f=] 3 (#$ . 4562)]) #@78 Returns t if first floating point number is less than second, nil otherwise. (defalias 'f< #[(a1 a2) " \n\"?" [f>= a1 a2] 3 (#$ . 4735)]) #@90 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 (#$ . 4881)]) #@81 Returns t if first floating point number is not equal to second, nil otherwise. (defalias 'f/= #[(a1 a2) " \n\"?" [f= a1 a2] 3 (#$ . 5039)]) #@52 Returns the minimum of two floating point numbers. (defalias 'fmin #[(a1 a2) " \n\" \n" [f< a1 a2] 3 (#$ . 5188)]) #@52 Returns the maximum of two floating point numbers. (defalias 'fmax #[(a1 a2) " \n\" \n" [f> a1 a2] 3 (#$ . 5315)]) #@64 Returns t if the floating point number is zero, nil otherwise. (defalias 'fzerop #[(fnum) "@U" [fnum 0] 2 (#$ . 5442)]) #@65 Returns t if the arg is a floating point number, nil otherwise. (defalias 'floatp #[(fnum) ":@A" [fnum] 1 (#$ . 5571)]) #@73 Convert the integer argument to floating point, like a C cast operator. (defalias 'f #[(int) " B!" [normalize int 0] 3 (#$ . 5709)]) #@63 Convert the integer argument to a C-style hexadecimal string. (defalias 'int-to-hex-string #[(int) "X#\f \n \"\"H!P \\\f+" [-20 "0x" "0123456789ABCDEF" hex-chars str shiftval 0 char-to-string logand lsh int 15 4] 8 (#$ . 5851)]) #@58 Truncate the fractional part of a floating point number. (defalias 'ftrunc #[(fnum) " A! A\n[XÇ @ A !+lj \f\"\f[\"5lj [\f\"\f[\"[\fB!*" [natnump fnum maxbit (0 . 1) exp mant normalize ash] 5 (#$ . 6109)]) #@89 Convert the floating point number to integer, with truncation, like a C cast operator. (defalias 'fint #[(fnum) " !@\nA Y%\f [X!% \f\"+" [ftrunc fnum tf tint texp mantissa-bits mantissa-maxval mantissa-minval ash] 4 (#$ . 6339)]) #@120 Convert the floating point number to a decimal string. Optional second argument non-nil means use scientific notation. (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\fXPZ." [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 (#$ . 6598)]) #@358 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. (defalias 'string-to-float #[(str) " \n#\n\" \n\"   P\f\n\"Κ GZ\fGWO\fHUOT5 Z\fO\fGVx\fHY\fO\f \fGZ\\\f!͂\\ׂ_!.\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 (#$ . 7411)]) (provide (quote float))