annotate lisp/prim/float-sup.el @ 164:4e0740e5aab2

Added tag r20-3b8 for changeset 0132846995bd
author cvs
date Mon, 13 Aug 2007 09:43:39 +0200
parents ac2d302a0011
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; float-sup.el --- detect absence of floating-point support in XEmacs runtime
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Maintainer: FSF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
23 ;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
25 ;;; Synched up with: FSF 19.34.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
26
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
27 ;;; Code:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; Provide a meaningful error message if we are running on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; bare (non-float) emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; Can't test for 'floatp since that may be defined by float-imitation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; packages like float.el in this very directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
34 ;; XEmacs change
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (or (featurep 'lisp-float-type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (error "Floating point was disabled at compile time"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; define pi and e via math-lib calls. (much less prone to killer typos.)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
39 ;; XEmacs change (purecopy)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (defconst pi (purecopy (* 4 (atan 1))) "The value of Pi (3.1415926...)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defconst e (purecopy (exp 1)) "The value of e (2.7182818...)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; Careful when editing this file ... typos here will be hard to spot.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; (defconst pi 3.14159265358979323846264338327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; "The value of Pi (3.14159265358979323846264338327...)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
47 ;; XEmacs change (purecopy)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defconst degrees-to-radians (purecopy (/ pi 180.0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Degrees to radian conversion constant")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (defconst radians-to-degrees (purecopy (/ 180.0 pi))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 "Radian to degree conversion constant")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
53 ;; these expand to a single multiply by a float when byte compiled
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defmacro degrees-to-radians (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 "Convert ARG from degrees to radians."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (list '* (/ pi 180.0) x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (defmacro radians-to-degrees (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 "Convert ARG from radians to degrees."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (list '* (/ 180.0 pi) x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
62 ;; Provided in C code in XEmacs
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
63 ;; (provide 'lisp-float-type)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
64
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;;; float-sup.el ends here