annotate src/floatfns.c @ 473:999d0b38694e

Initial revision
author Jim Blandy <jimb@redhat.com>
date Sat, 21 Dec 1991 08:23:15 +0000
parents 0d3a6b3b64a4
children 8c615e453683
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
102
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
1 /* Primitive operations on floating point for GNU Emacs Lisp interpreter.
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
2 Copyright (C) 1988 Free Software Foundation, Inc.
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
3
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
4 This file is part of GNU Emacs.
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
5
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
8 the Free Software Foundation; either version 1, or (at your option)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
9 any later version.
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
10
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
14 GNU General Public License for more details.
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
15
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
19
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
20
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
21 #include <signal.h>
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
22
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
23 #include "config.h"
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
24 #include "lisp.h"
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
25
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
26 Lisp_Object Qarith_error;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
27
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
28 #ifdef LISP_FLOAT_TYPE
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
29 #include <math.h>
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
30
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
31 /* Nonzero while executing in floating point.
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
32 This tells float_error what to do. */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
33
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
34 static int in_float;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
35
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
36 /* If an argument is out of range for a mathematical function,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
37 that is detected with a signal. Here is the actual argument
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
38 value to use in the error message. */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
39
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
40 static Lisp_Object float_error_arg;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
41
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
42 #define IN_FLOAT(d, num) \
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
43 (in_float = 1, float_error_arg = num, (d), in_float = 0)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
44
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
45 /* Extract a Lisp number as a `double', or signal an error. */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
46
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
47 double
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
48 extract_float (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
49 Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
50 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
51 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
52
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
53 if (XTYPE (num) == Lisp_Float)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
54 return XFLOAT (num)->data;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
55 return (double) XINT (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
56 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
57
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
58 DEFUN ("acos", Facos, Sacos, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
59 "Return the inverse cosine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
60 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
61 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
62 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
63 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
64 IN_FLOAT (d = acos (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
65 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
66 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
67
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
68 DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
69 "Return the inverse hyperbolic cosine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
70 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
71 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
72 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
73 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
74 IN_FLOAT (d = acosh (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
75 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
76 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
77
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
78 DEFUN ("asin", Fasin, Sasin, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
79 "Return the inverse sine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
80 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
81 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
82 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
83 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
84 IN_FLOAT (d = asin (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
85 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
86 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
87
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
88 DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
89 "Return the inverse hyperbolic sine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
90 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
91 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
92 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
93 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
94 IN_FLOAT (d = asinh (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
95 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
96 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
97
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
98 DEFUN ("atan", Fatan, Satan, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
99 "Return the inverse tangent of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
100 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
101 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
102 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
103 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
104 IN_FLOAT (d = atan (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
105 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
106 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
107
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
108 DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
109 "Return the inverse hyperbolic tangent of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
110 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
111 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
112 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
113 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
114 IN_FLOAT (d = atanh (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
115 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
116 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
117
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
118 DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
119 "Return the bessel function j0 of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
120 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
121 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
122 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
123 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
124 IN_FLOAT (d = j0 (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
125 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
126 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
127
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
128 DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
129 "Return the bessel function j1 of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
130 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
131 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
132 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
133 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
134 IN_FLOAT (d = j1 (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
135 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
136 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
137
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
138 DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
139 "Return the order N bessel function output jn of ARG.\n\
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
140 The first arg (the order) is truncated to an integer.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
141 (num1, num2)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
142 register Lisp_Object num1, num2;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
143 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
144 int i1 = extract_float (num1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
145 double f2 = extract_float (num2);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
146
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
147 IN_FLOAT (f2 = jn (i1, f2), num1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
148 return make_float (f2);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
149 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
150
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
151 DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
152 "Return the bessel function y0 of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
153 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
154 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
155 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
156 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
157 IN_FLOAT (d = y0 (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
158 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
159 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
160
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
161 DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
162 "Return the bessel function y1 of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
163 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
164 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
165 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
166 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
167 IN_FLOAT (d = y1 (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
168 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
169 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
170
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
171 DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
172 "Return the order N bessel function output yn of ARG.\n\
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
173 The first arg (the order) is truncated to an integer.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
174 (num1, num2)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
175 register Lisp_Object num1, num2;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
176 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
177 int i1 = extract_float (num1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
178 double f2 = extract_float (num2);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
179
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
180 IN_FLOAT (f2 = yn (i1, f2), num1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
181 return make_float (f2);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
182 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
183
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
184 DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
185 "Return the cube root of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
186 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
187 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
188 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
189 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
190 IN_FLOAT (d = cbrt (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
191 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
192 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
193
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
194 DEFUN ("cos", Fcos, Scos, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
195 "Return the cosine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
196 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
197 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
198 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
199 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
200 IN_FLOAT (d = cos (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
201 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
202 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
203
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
204 DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
205 "Return the hyperbolic cosine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
206 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
207 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
208 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
209 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
210 IN_FLOAT (d = cosh (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
211 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
212 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
213
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
214 DEFUN ("erf", Ferf, Serf, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
215 "Return the mathematical error function of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
216 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
217 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
218 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
219 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
220 IN_FLOAT (d = erf (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
221 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
222 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
223
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
224 DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
225 "Return the complementary error function of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
226 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
227 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
228 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
229 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
230 IN_FLOAT (d = erfc (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
231 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
232 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
233
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
234 DEFUN ("exp", Fexp, Sexp, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
235 "Return the exponential base e of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
236 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
237 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
238 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
239 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
240 IN_FLOAT (d = exp (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
241 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
242 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
243
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
244 DEFUN ("expm1", Fexpm1, Sexpm1, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
245 "Return the exp (x)-1 of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
246 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
247 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
248 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
249 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
250 IN_FLOAT (d = expm1 (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
251 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
252 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
253
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
254 DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
255 "Return the log gamma of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
256 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
257 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
258 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
259 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
260 IN_FLOAT (d = lgamma (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
261 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
262 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
263
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
264 DEFUN ("log", Flog, Slog, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
265 "Return the natural logarithm of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
266 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
267 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
268 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
269 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
270 IN_FLOAT (d = log (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
271 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
272 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
273
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
274 DEFUN ("log10", Flog10, Slog10, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
275 "Return the logarithm base 10 of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
276 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
277 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
278 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
279 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
280 IN_FLOAT (d = log10 (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
281 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
282 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
283
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
284 DEFUN ("log1p", Flog1p, Slog1p, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
285 "Return the log (1+x) of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
286 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
287 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
288 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
289 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
290 IN_FLOAT (d = log1p (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
291 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
292 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
293
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
294 DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
295 "Return the exponential x ** y.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
296 (num1, num2)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
297 register Lisp_Object num1, num2;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
298 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
299 double f1, f2;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
300
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
301 CHECK_NUMBER_OR_FLOAT (num1, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
302 CHECK_NUMBER_OR_FLOAT (num2, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
303 if ((XTYPE (num1) == Lisp_Int) && /* common lisp spec */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
304 (XTYPE (num2) == Lisp_Int)) /* don't promote, if both are ints */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
305 { /* this can be improved by pre-calculating */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
306 int acc, x, y; /* some binary powers of x then acumulating */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
307 /* these, therby saving some time. -wsr */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
308 x = XINT (num1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
309 y = XINT (num2);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
310 acc = 1;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
311
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
312 if (y < 0)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
313 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
314 for (; y < 0; y++)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
315 acc /= x;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
316 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
317 else
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
318 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
319 for (; y > 0; y--)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
320 acc *= x;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
321 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
322 return XSET (x, Lisp_Int, acc);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
323 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
324 f1 = (XTYPE (num1) == Lisp_Float) ? XFLOAT (num1)->data : XINT (num1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
325 f2 = (XTYPE (num2) == Lisp_Float) ? XFLOAT (num2)->data : XINT (num2);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
326 IN_FLOAT (f1 = pow (f1, f2), num1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
327 return make_float (f1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
328 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
329
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
330 DEFUN ("sin", Fsin, Ssin, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
331 "Return the sine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
332 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
333 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
334 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
335 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
336 IN_FLOAT (d = sin (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
337 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
338 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
339
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
340 DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
341 "Return the hyperbolic sine of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
342 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
343 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
344 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
345 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
346 IN_FLOAT (d = sinh (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
347 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
348 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
349
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
350 DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
351 "Return the square root of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
352 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
353 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
354 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
355 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
356 IN_FLOAT (d = sqrt (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
357 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
358 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
359
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
360 DEFUN ("tan", Ftan, Stan, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
361 "Return the tangent of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
362 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
363 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
364 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
365 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
366 IN_FLOAT (d = tan (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
367 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
368 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
369
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
370 DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
371 "Return the hyperbolic tangent of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
372 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
373 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
374 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
375 double d = extract_float (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
376 IN_FLOAT (d = tanh (d), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
377 return make_float (d);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
378 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
379
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
380 DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
381 "Return the absolute value of ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
382 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
383 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
384 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
385 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
386
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
387 if (XTYPE (num) == Lisp_Float)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
388 IN_FLOAT (num = make_float (fabs (XFLOAT (num)->data)), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
389 else if (XINT (num) < 0)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
390 XSETINT (num, - XFASTINT (num));
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
391
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
392 return num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
393 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
394
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
395 DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
396 "Return the floating point number equal to ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
397 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
398 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
399 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
400 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
401
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
402 if (XTYPE (num) == Lisp_Int)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
403 return make_float ((double) XINT (num));
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
404 else /* give 'em the same float back */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
405 return num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
406 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
407
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
408 DEFUN ("logb", Flogb, Slogb, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
409 "Returns the integer that is the base 2 log of ARG.\n\
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
410 This is the same as the exponent of a float.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
411 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
412 Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
413 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
414 Lisp_Object val;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
415 double f;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
416
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
417 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
418 f = (XTYPE (num) == Lisp_Float) ? XFLOAT (num)->data : XINT (num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
419 IN_FLOAT (val = logb (f), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
420 XSET (val, Lisp_Int, val);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
421 return val;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
422 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
423
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
424 /* the rounding functions */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
425
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
426 DEFUN ("ceiling", Fceiling, Sceiling, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
427 "Return the smallest integer no less than ARG. (Round toward +inf.)")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
428 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
429 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
430 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
431 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
432
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
433 if (XTYPE (num) == Lisp_Float)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
434 IN_FLOAT (XSET (num, Lisp_Int, ceil (XFLOAT (num)->data)), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
435
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
436 return num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
437 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
438
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
439 DEFUN ("floor", Ffloor, Sfloor, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
440 "Return the largest integer no greater than ARG. (Round towards -inf.)")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
441 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
442 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
443 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
444 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
445
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
446 if (XTYPE (num) == Lisp_Float)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
447 IN_FLOAT (XSET (num, Lisp_Int, floor (XFLOAT (num)->data)), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
448
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
449 return num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
450 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
451
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
452 DEFUN ("round", Fround, Sround, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
453 "Return the nearest integer to ARG.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
454 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
455 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
456 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
457 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
458
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
459 if (XTYPE (num) == Lisp_Float)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
460 IN_FLOAT (XSET (num, Lisp_Int, rint (XFLOAT (num)->data)), num);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
461
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
462 return num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
463 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
464
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
465 DEFUN ("truncate", Ftruncate, Struncate, 1, 1, 0,
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
466 "Truncate a floating point number to an int.\n\
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
467 Rounds the value toward zero.")
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
468 (num)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
469 register Lisp_Object num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
470 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
471 CHECK_NUMBER_OR_FLOAT (num, 0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
472
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
473 if (XTYPE (num) == Lisp_Float)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
474 XSET (num, Lisp_Int, (int) XFLOAT (num)->data);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
475
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
476 return num;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
477 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
478
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
479 #ifdef BSD
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
480 static
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
481 float_error (signo)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
482 int signo;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
483 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
484 if (! in_float)
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
485 fatal_error_signal (signo);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
486
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
487 #ifdef BSD4_1
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
488 sigrelse (SIGILL);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
489 #else /* not BSD4_1 */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
490 sigsetmask (0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
491 #endif /* not BSD4_1 */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
492
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
493 in_float = 0;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
494
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
495 Fsignal (Qarith_error, Fcons (float_error_arg, Qnil));
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
496 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
497
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
498 /* Another idea was to replace the library function `infnan'
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
499 where SIGILL is signaled. */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
500
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
501 #endif /* BSD */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
502
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
503 init_floatfns ()
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
504 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
505 signal (SIGILL, float_error);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
506 in_float = 0;
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
507 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
508
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
509 syms_of_floatfns ()
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
510 {
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
511 defsubr (&Sacos);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
512 defsubr (&Sacosh);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
513 defsubr (&Sasin);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
514 defsubr (&Sasinh);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
515 defsubr (&Satan);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
516 defsubr (&Satanh);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
517 defsubr (&Sbessel_y0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
518 defsubr (&Sbessel_y1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
519 defsubr (&Sbessel_yn);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
520 defsubr (&Sbessel_j0);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
521 defsubr (&Sbessel_j1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
522 defsubr (&Sbessel_jn);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
523 defsubr (&Scube_root);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
524 defsubr (&Scos);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
525 defsubr (&Scosh);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
526 defsubr (&Serf);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
527 defsubr (&Serfc);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
528 defsubr (&Sexp);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
529 defsubr (&Sexpm1);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
530 defsubr (&Slog_gamma);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
531 defsubr (&Slog);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
532 defsubr (&Slog10);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
533 defsubr (&Slog1p);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
534 defsubr (&Sexpt);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
535 defsubr (&Ssin);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
536 defsubr (&Ssinh);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
537 defsubr (&Ssqrt);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
538 defsubr (&Stan);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
539 defsubr (&Stanh);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
540
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
541 defsubr (&Sabs);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
542 defsubr (&Sfloat);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
543 defsubr (&Slogb);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
544 defsubr (&Sceiling);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
545 defsubr (&Sfloor);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
546 defsubr (&Sround);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
547 defsubr (&Struncate);
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
548 }
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
549
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
550 #else /* not LISP_FLOAT_TYPE */
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
551
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
552 init_floatfns ()
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
553 {}
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
554
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
555 syms_of_floatfns ()
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
556 {}
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
557
0d3a6b3b64a4 Initial revision
Mike Rowan <mtr@gnu.org>
parents:
diff changeset
558 #endif /* not LISP_FLOAT_TYPE */