Backport memory fix (2014-03-23T05:15:48Z!dancol@dancol.org) from trunk
[bpt/emacs.git] / src / floatfns.c
CommitLineData
b70021f4 1/* Primitive operations on floating point for GNU Emacs Lisp interpreter.
95df8112 2
ba318903 3Copyright (C) 1988, 1993-1994, 1999, 2001-2014 Free Software Foundation,
ab422c4d 4Inc.
b70021f4 5
0a9dd3a7
GM
6Author: Wolfgang Rupprecht
7(according to ack.texi)
8
b70021f4
MR
9This file is part of GNU Emacs.
10
9ec0b715 11GNU Emacs is free software: you can redistribute it and/or modify
b70021f4 12it under the terms of the GNU General Public License as published by
9ec0b715
GM
13the Free Software Foundation, either version 3 of the License, or
14(at your option) any later version.
b70021f4
MR
15
16GNU Emacs is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
9ec0b715 22along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
b70021f4
MR
23
24
c990426a
PE
25/* C89 requires only the following math.h functions, and Emacs omits
26 the starred functions since we haven't found a use for them:
27 acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod,
89561f72
PE
28 frexp, ldexp, log, log10 [via (log X 10)], *modf, pow, sin, *sinh,
29 sqrt, tan, *tanh.
33cbd259
PE
30
31 C99 and C11 require the following math.h functions in addition to
32 the C89 functions. Of these, Emacs currently exports only the
33 starred ones to Lisp, since we haven't found a use for the others:
34 acosh, atanh, cbrt, *copysign, erf, erfc, exp2, expm1, fdim, fma,
35 fmax, fmin, fpclassify, hypot, ilogb, isfinite, isgreater,
36 isgreaterequal, isinf, isless, islessequal, islessgreater, *isnan,
89561f72
PE
37 isnormal, isunordered, lgamma, log1p, *log2 [via (log X 2)], *logb
38 (approximately), lrint/llrint, lround/llround, nan, nearbyint,
39 nextafter, nexttoward, remainder, remquo, *rint, round, scalbln,
40 scalbn, signbit, tgamma, trunc.
4b6baf5f
RS
41 */
42
18160b98 43#include <config.h>
0328b6de 44
523e9291 45#include "lisp.h"
d137ae2f 46
b70021f4 47#include <math.h>
4b6baf5f 48
e4ea223d
PE
49/* 'isfinite' and 'isnan' cause build failures on Solaris 10 with the
50 bundled GCC in c99 mode. Work around the bugs with simple
51 implementations that are good enough. */
52#undef isfinite
53#define isfinite(x) ((x) - (x) == 0)
54#undef isnan
55#define isnan(x) ((x) != (x))
c26406fe 56
84575e67
PE
57/* Check that X is a floating point number. */
58
59static void
60CHECK_FLOAT (Lisp_Object x)
61{
62 CHECK_TYPE (FLOATP (x), Qfloatp, x);
63}
64
b70021f4
MR
65/* Extract a Lisp number as a `double', or signal an error. */
66
67double
d5a3eaaf 68extract_float (Lisp_Object num)
b70021f4 69{
b7826503 70 CHECK_NUMBER_OR_FLOAT (num);
b70021f4 71
207a45c1 72 if (FLOATP (num))
70949dac 73 return XFLOAT_DATA (num);
b70021f4
MR
74 return (double) XINT (num);
75}
c2d4ea74
RS
76\f
77/* Trig functions. */
b70021f4
MR
78
79DEFUN ("acos", Facos, Sacos, 1, 1, 0,
335c5470 80 doc: /* Return the inverse cosine of ARG. */)
f6196b87 81 (Lisp_Object arg)
b70021f4 82{
4b6baf5f 83 double d = extract_float (arg);
f6196b87 84 d = acos (d);
b70021f4
MR
85 return make_float (d);
86}
87
c2d4ea74 88DEFUN ("asin", Fasin, Sasin, 1, 1, 0,
335c5470 89 doc: /* Return the inverse sine of ARG. */)
f6196b87 90 (Lisp_Object arg)
b70021f4 91{
4b6baf5f 92 double d = extract_float (arg);
f6196b87 93 d = asin (d);
b70021f4
MR
94 return make_float (d);
95}
96
250ffca6
EZ
97DEFUN ("atan", Fatan, Satan, 1, 2, 0,
98 doc: /* Return the inverse tangent of the arguments.
99If only one argument Y is given, return the inverse tangent of Y.
100If two arguments Y and X are given, return the inverse tangent of Y
101divided by X, i.e. the angle in radians between the vector (X, Y)
102and the x-axis. */)
f6196b87 103 (Lisp_Object y, Lisp_Object x)
b70021f4 104{
250ffca6
EZ
105 double d = extract_float (y);
106
107 if (NILP (x))
f6196b87 108 d = atan (d);
250ffca6
EZ
109 else
110 {
111 double d2 = extract_float (x);
f6196b87 112 d = atan2 (d, d2);
250ffca6 113 }
b70021f4
MR
114 return make_float (d);
115}
116
c2d4ea74 117DEFUN ("cos", Fcos, Scos, 1, 1, 0,
335c5470 118 doc: /* Return the cosine of ARG. */)
f6196b87 119 (Lisp_Object arg)
b70021f4 120{
4b6baf5f 121 double d = extract_float (arg);
f6196b87 122 d = cos (d);
b70021f4
MR
123 return make_float (d);
124}
125
c2d4ea74 126DEFUN ("sin", Fsin, Ssin, 1, 1, 0,
335c5470 127 doc: /* Return the sine of ARG. */)
f6196b87 128 (Lisp_Object arg)
b70021f4 129{
4b6baf5f 130 double d = extract_float (arg);
f6196b87 131 d = sin (d);
b70021f4
MR
132 return make_float (d);
133}
134
c2d4ea74 135DEFUN ("tan", Ftan, Stan, 1, 1, 0,
335c5470 136 doc: /* Return the tangent of ARG. */)
f6196b87 137 (Lisp_Object arg)
4b6baf5f
RS
138{
139 double d = extract_float (arg);
f6196b87 140 d = tan (d);
b70021f4
MR
141 return make_float (d);
142}
15e12598 143
15e12598
VB
144DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
145 doc: /* Return non nil iff argument X is a NaN. */)
5842a27b 146 (Lisp_Object x)
15e12598
VB
147{
148 CHECK_FLOAT (x);
149 return isnan (XFLOAT_DATA (x)) ? Qt : Qnil;
150}
151
c8199d0f 152#ifdef HAVE_COPYSIGN
3c2907f7 153DEFUN ("copysign", Fcopysign, Scopysign, 2, 2, 0,
15e12598
VB
154 doc: /* Copy sign of X2 to value of X1, and return the result.
155Cause an error if X1 or X2 is not a float. */)
5842a27b 156 (Lisp_Object x1, Lisp_Object x2)
15e12598
VB
157{
158 double f1, f2;
159
160 CHECK_FLOAT (x1);
161 CHECK_FLOAT (x2);
162
163 f1 = XFLOAT_DATA (x1);
164 f2 = XFLOAT_DATA (x2);
165
166 return make_float (copysign (f1, f2));
167}
c990426a 168#endif
15e12598
VB
169
170DEFUN ("frexp", Ffrexp, Sfrexp, 1, 1, 0,
171 doc: /* Get significand and exponent of a floating point number.
172Breaks the floating point number X into its binary significand SGNFCAND
173\(a floating point value between 0.5 (included) and 1.0 (excluded))
174and an integral exponent EXP for 2, such that:
175
176 X = SGNFCAND * 2^EXP
177
178The function returns the cons cell (SGNFCAND . EXP).
179If X is zero, both parts (SGNFCAND and EXP) are zero. */)
5842a27b 180 (Lisp_Object x)
15e12598
VB
181{
182 double f = XFLOATINT (x);
c990426a
PE
183 int exponent;
184 double sgnfcand = frexp (f, &exponent);
185 return Fcons (make_float (sgnfcand), make_number (exponent));
15e12598
VB
186}
187
188DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
189 doc: /* Construct number X from significand SGNFCAND and exponent EXP.
190Returns the floating point value resulting from multiplying SGNFCAND
191(the significand) by 2 raised to the power of EXP (the exponent). */)
a885e2ed 192 (Lisp_Object sgnfcand, Lisp_Object exponent)
15e12598 193{
a885e2ed
PE
194 CHECK_NUMBER (exponent);
195 return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exponent)));
15e12598 196}
706ac90d 197\f
c2d4ea74 198DEFUN ("exp", Fexp, Sexp, 1, 1, 0,
335c5470 199 doc: /* Return the exponential base e of ARG. */)
f6196b87 200 (Lisp_Object arg)
4b6baf5f
RS
201{
202 double d = extract_float (arg);
f6196b87 203 d = exp (d);
b70021f4
MR
204 return make_float (d);
205}
206
b70021f4 207DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
335c5470 208 doc: /* Return the exponential ARG1 ** ARG2. */)
f6196b87 209 (Lisp_Object arg1, Lisp_Object arg2)
b70021f4 210{
2742fe30 211 double f1, f2, f3;
b70021f4 212
b7826503
PJ
213 CHECK_NUMBER_OR_FLOAT (arg1);
214 CHECK_NUMBER_OR_FLOAT (arg2);
207a45c1 215 if (INTEGERP (arg1) /* common lisp spec */
5a9807a8 216 && INTEGERP (arg2) /* don't promote, if both are ints, and */
908589fd 217 && XINT (arg2) >= 0) /* we are sure the result is not fractional */
b70021f4 218 { /* this can be improved by pre-calculating */
125b3835
PE
219 EMACS_INT y; /* some binary powers of x then accumulating */
220 EMACS_UINT acc, x; /* Unsigned so that overflow is well defined. */
4be1d460
RS
221 Lisp_Object val;
222
4b6baf5f
RS
223 x = XINT (arg1);
224 y = XINT (arg2);
8d1da888 225 acc = (y & 1 ? x : 1);
177c0ea7 226
8d1da888 227 while ((y >>= 1) != 0)
b70021f4 228 {
8d1da888
PE
229 x *= x;
230 if (y & 1)
231 acc *= x;
b70021f4 232 }
e0cb2a68 233 XSETINT (val, acc);
4be1d460 234 return val;
b70021f4 235 }
70949dac
KR
236 f1 = FLOATP (arg1) ? XFLOAT_DATA (arg1) : XINT (arg1);
237 f2 = FLOATP (arg2) ? XFLOAT_DATA (arg2) : XINT (arg2);
f6196b87 238 f3 = pow (f1, f2);
2742fe30 239 return make_float (f3);
b70021f4 240}
c2d4ea74 241
56abb480 242DEFUN ("log", Flog, Slog, 1, 2, 0,
335c5470 243 doc: /* Return the natural logarithm of ARG.
356e6d8d 244If the optional argument BASE is given, return log ARG using that base. */)
f6196b87 245 (Lisp_Object arg, Lisp_Object base)
b70021f4 246{
4b6baf5f 247 double d = extract_float (arg);
56abb480
JB
248
249 if (NILP (base))
f6196b87 250 d = log (d);
56abb480
JB
251 else
252 {
253 double b = extract_float (base);
254
4b6baf5f 255 if (b == 10.0)
f6196b87 256 d = log10 (d);
89561f72
PE
257#if HAVE_LOG2
258 else if (b == 2.0)
259 d = log2 (d);
260#endif
4b6baf5f 261 else
f6196b87 262 d = log (d) / log (b);
56abb480 263 }
b70021f4
MR
264 return make_float (d);
265}
266
b70021f4 267DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0,
335c5470 268 doc: /* Return the square root of ARG. */)
f6196b87 269 (Lisp_Object arg)
b70021f4 270{
4b6baf5f 271 double d = extract_float (arg);
f6196b87 272 d = sqrt (d);
b70021f4
MR
273 return make_float (d);
274}
c2d4ea74 275\f
b70021f4 276DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
335c5470 277 doc: /* Return the absolute value of ARG. */)
5842a27b 278 (register Lisp_Object arg)
b70021f4 279{
b7826503 280 CHECK_NUMBER_OR_FLOAT (arg);
b70021f4 281
207a45c1 282 if (FLOATP (arg))
7c26cf3c 283 arg = make_float (fabs (XFLOAT_DATA (arg)));
4b6baf5f 284 else if (XINT (arg) < 0)
db37cb37 285 XSETINT (arg, - XINT (arg));
b70021f4 286
4b6baf5f 287 return arg;
b70021f4
MR
288}
289
a7ca3326 290DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
335c5470 291 doc: /* Return the floating point number equal to ARG. */)
5842a27b 292 (register Lisp_Object arg)
b70021f4 293{
b7826503 294 CHECK_NUMBER_OR_FLOAT (arg);
b70021f4 295
207a45c1 296 if (INTEGERP (arg))
4b6baf5f 297 return make_float ((double) XINT (arg));
b70021f4 298 else /* give 'em the same float back */
4b6baf5f 299 return arg;
b70021f4
MR
300}
301
302DEFUN ("logb", Flogb, Slogb, 1, 1, 0,
335c5470
PJ
303 doc: /* Returns largest integer <= the base 2 log of the magnitude of ARG.
304This is the same as the exponent of a float. */)
5842a27b 305 (Lisp_Object arg)
b70021f4 306{
340176df 307 Lisp_Object val;
a7bf3c54 308 EMACS_INT value;
5bf54166 309 double f = extract_float (arg);
340176df 310
6694b327 311 if (f == 0.0)
b916d672 312 value = MOST_NEGATIVE_FIXNUM;
c990426a 313 else if (isfinite (f))
6694b327 314 {
c8bf6cf3 315 int ivalue;
f6196b87 316 frexp (f, &ivalue);
c8bf6cf3 317 value = ivalue - 1;
6694b327 318 }
c990426a
PE
319 else
320 value = MOST_POSITIVE_FIXNUM;
321
e0cb2a68 322 XSETINT (val, value);
c26406fe 323 return val;
b70021f4
MR
324}
325
fc2157cb 326
acbbacbe
PE
327/* the rounding functions */
328
329static Lisp_Object
d2aa42f8
DN
330rounding_driver (Lisp_Object arg, Lisp_Object divisor,
331 double (*double_round) (double),
332 EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT),
8ea90aa3 333 const char *name)
b70021f4 334{
b7826503 335 CHECK_NUMBER_OR_FLOAT (arg);
b70021f4 336
fc2157cb
PE
337 if (! NILP (divisor))
338 {
9a51b24a 339 EMACS_INT i1, i2;
fc2157cb 340
b7826503 341 CHECK_NUMBER_OR_FLOAT (divisor);
fc2157cb 342
207a45c1 343 if (FLOATP (arg) || FLOATP (divisor))
fc2157cb
PE
344 {
345 double f1, f2;
346
70949dac
KR
347 f1 = FLOATP (arg) ? XFLOAT_DATA (arg) : XINT (arg);
348 f2 = (FLOATP (divisor) ? XFLOAT_DATA (divisor) : XINT (divisor));
d137ae2f 349 if (! IEEE_FLOATING_POINT && f2 == 0)
edef1631 350 xsignal0 (Qarith_error);
fc2157cb 351
f6196b87
PE
352 f1 = (*double_round) (f1 / f2);
353 if (FIXNUM_OVERFLOW_P (f1))
354 xsignal3 (Qrange_error, build_string (name), arg, divisor);
355 arg = make_number (f1);
fc2157cb
PE
356 return arg;
357 }
fc2157cb
PE
358
359 i1 = XINT (arg);
360 i2 = XINT (divisor);
361
362 if (i2 == 0)
edef1631 363 xsignal0 (Qarith_error);
fc2157cb 364
acbbacbe 365 XSETINT (arg, (*int_round2) (i1, i2));
fc2157cb
PE
366 return arg;
367 }
368
207a45c1 369 if (FLOATP (arg))
81a63ccc 370 {
f6196b87
PE
371 double d = (*double_round) (XFLOAT_DATA (arg));
372 if (FIXNUM_OVERFLOW_P (d))
373 xsignal2 (Qrange_error, build_string (name), arg);
374 arg = make_number (d);
81a63ccc 375 }
b70021f4 376
4b6baf5f 377 return arg;
b70021f4
MR
378}
379
acbbacbe
PE
380/* With C's /, the result is implementation-defined if either operand
381 is negative, so take care with negative operands in the following
382 integer functions. */
383
384static EMACS_INT
d2aa42f8 385ceiling2 (EMACS_INT i1, EMACS_INT i2)
acbbacbe
PE
386{
387 return (i2 < 0
388 ? (i1 < 0 ? ((-1 - i1) / -i2) + 1 : - (i1 / -i2))
389 : (i1 <= 0 ? - (-i1 / i2) : ((i1 - 1) / i2) + 1));
390}
391
392static EMACS_INT
d2aa42f8 393floor2 (EMACS_INT i1, EMACS_INT i2)
acbbacbe
PE
394{
395 return (i2 < 0
396 ? (i1 <= 0 ? -i1 / -i2 : -1 - ((i1 - 1) / -i2))
397 : (i1 < 0 ? -1 - ((-1 - i1) / i2) : i1 / i2));
398}
399
400static EMACS_INT
d2aa42f8 401truncate2 (EMACS_INT i1, EMACS_INT i2)
acbbacbe
PE
402{
403 return (i2 < 0
404 ? (i1 < 0 ? -i1 / -i2 : - (i1 / -i2))
405 : (i1 < 0 ? - (-i1 / i2) : i1 / i2));
406}
407
408static EMACS_INT
d2aa42f8 409round2 (EMACS_INT i1, EMACS_INT i2)
acbbacbe
PE
410{
411 /* The C language's division operator gives us one remainder R, but
412 we want the remainder R1 on the other side of 0 if R1 is closer
413 to 0 than R is; because we want to round to even, we also want R1
414 if R and R1 are the same distance from 0 and if C's quotient is
415 odd. */
416 EMACS_INT q = i1 / i2;
417 EMACS_INT r = i1 % i2;
71376d4b
PE
418 EMACS_INT abs_r = eabs (r);
419 EMACS_INT abs_r1 = eabs (i2) - abs_r;
acbbacbe
PE
420 return q + (abs_r + (q & 1) <= abs_r1 ? 0 : (i2 ^ r) < 0 ? -1 : 1);
421}
422
dca6c914
RS
423/* The code uses emacs_rint, so that it works to undefine HAVE_RINT
424 if `rint' exists but does not work right. */
425#ifdef HAVE_RINT
426#define emacs_rint rint
427#else
4b5878a8 428static double
d2aa42f8 429emacs_rint (double d)
4b5878a8 430{
37ca9077
PE
431 double d1 = d + 0.5;
432 double r = floor (d1);
433 return r - (r == d1 && fmod (r, 2) != 0);
4b5878a8
KH
434}
435#endif
436
acbbacbe 437static double
d2aa42f8 438double_identity (double d)
acbbacbe
PE
439{
440 return d;
441}
442
443DEFUN ("ceiling", Fceiling, Sceiling, 1, 2, 0,
1d6ea92f
RS
444 doc: /* Return the smallest integer no less than ARG.
445This rounds the value towards +inf.
335c5470 446With optional DIVISOR, return the smallest integer no less than ARG/DIVISOR. */)
5842a27b 447 (Lisp_Object arg, Lisp_Object divisor)
acbbacbe
PE
448{
449 return rounding_driver (arg, divisor, ceil, ceiling2, "ceiling");
450}
451
452DEFUN ("floor", Ffloor, Sfloor, 1, 2, 0,
1d6ea92f 453 doc: /* Return the largest integer no greater than ARG.
568b6e41 454This rounds the value towards -inf.
335c5470 455With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR. */)
5842a27b 456 (Lisp_Object arg, Lisp_Object divisor)
acbbacbe
PE
457{
458 return rounding_driver (arg, divisor, floor, floor2, "floor");
459}
460
461DEFUN ("round", Fround, Sround, 1, 2, 0,
335c5470 462 doc: /* Return the nearest integer to ARG.
6ded2c89
EZ
463With optional DIVISOR, return the nearest integer to ARG/DIVISOR.
464
a32a4857
EZ
465Rounding a value equidistant between two integers may choose the
466integer closer to zero, or it may prefer an even integer, depending on
467your machine. For example, \(round 2.5\) can return 3 on some
59fe0cee 468systems, but 2 on others. */)
5842a27b 469 (Lisp_Object arg, Lisp_Object divisor)
acbbacbe 470{
dca6c914 471 return rounding_driver (arg, divisor, emacs_rint, round2, "round");
acbbacbe
PE
472}
473
a7ca3326 474DEFUN ("truncate", Ftruncate, Struncate, 1, 2, 0,
335c5470
PJ
475 doc: /* Truncate a floating point number to an int.
476Rounds ARG toward zero.
477With optional DIVISOR, truncate ARG/DIVISOR. */)
5842a27b 478 (Lisp_Object arg, Lisp_Object divisor)
acbbacbe
PE
479{
480 return rounding_driver (arg, divisor, double_identity, truncate2,
481 "truncate");
482}
483
fc2157cb 484
d137ae2f 485Lisp_Object
dd4c5104 486fmod_float (Lisp_Object x, Lisp_Object y)
d137ae2f
PE
487{
488 double f1, f2;
489
70949dac
KR
490 f1 = FLOATP (x) ? XFLOAT_DATA (x) : XINT (x);
491 f2 = FLOATP (y) ? XFLOAT_DATA (y) : XINT (y);
d137ae2f 492
f6196b87 493 f1 = fmod (f1, f2);
d137ae2f
PE
494
495 /* If the "remainder" comes out with the wrong sign, fix it. */
908589fd 496 if (f2 < 0 ? f1 > 0 : f1 < 0)
f6196b87
PE
497 f1 += f2;
498
d137ae2f
PE
499 return make_float (f1);
500}
4b6baf5f 501\f
4b6baf5f 502DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
335c5470
PJ
503 doc: /* Return the smallest integer no less than ARG, as a float.
504\(Round toward +inf.\) */)
f6196b87 505 (Lisp_Object arg)
4b6baf5f
RS
506{
507 double d = extract_float (arg);
f6196b87 508 d = ceil (d);
4b6baf5f
RS
509 return make_float (d);
510}
511
512DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0,
335c5470
PJ
513 doc: /* Return the largest integer no greater than ARG, as a float.
514\(Round towards -inf.\) */)
f6196b87 515 (Lisp_Object arg)
4b6baf5f
RS
516{
517 double d = extract_float (arg);
f6196b87 518 d = floor (d);
4b6baf5f
RS
519 return make_float (d);
520}
b70021f4 521
4b6baf5f 522DEFUN ("fround", Ffround, Sfround, 1, 1, 0,
335c5470 523 doc: /* Return the nearest integer to ARG, as a float. */)
f6196b87 524 (Lisp_Object arg)
4b6baf5f
RS
525{
526 double d = extract_float (arg);
f6196b87 527 d = emacs_rint (d);
4b6baf5f
RS
528 return make_float (d);
529}
530
531DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0,
335c5470
PJ
532 doc: /* Truncate a floating point number to an integral float value.
533Rounds the value toward zero. */)
f6196b87 534 (Lisp_Object arg)
4b6baf5f
RS
535{
536 double d = extract_float (arg);
537 if (d >= 0.0)
f6196b87 538 d = floor (d);
4b6baf5f 539 else
f6196b87 540 d = ceil (d);
4b6baf5f 541 return make_float (d);
b70021f4
MR
542}
543\f
dfcf069d 544void
d5a3eaaf 545syms_of_floatfns (void)
b70021f4
MR
546{
547 defsubr (&Sacos);
b70021f4 548 defsubr (&Sasin);
b70021f4 549 defsubr (&Satan);
c2d4ea74
RS
550 defsubr (&Scos);
551 defsubr (&Ssin);
552 defsubr (&Stan);
15e12598 553 defsubr (&Sisnan);
c8199d0f 554#ifdef HAVE_COPYSIGN
15e12598 555 defsubr (&Scopysign);
c990426a 556#endif
15e12598
VB
557 defsubr (&Sfrexp);
558 defsubr (&Sldexp);
4b6baf5f
RS
559 defsubr (&Sfceiling);
560 defsubr (&Sffloor);
561 defsubr (&Sfround);
562 defsubr (&Sftruncate);
b70021f4 563 defsubr (&Sexp);
c2d4ea74 564 defsubr (&Sexpt);
b70021f4 565 defsubr (&Slog);
b70021f4 566 defsubr (&Ssqrt);
b70021f4
MR
567
568 defsubr (&Sabs);
569 defsubr (&Sfloat);
570 defsubr (&Slogb);
571 defsubr (&Sceiling);
acbbacbe 572 defsubr (&Sfloor);
b70021f4
MR
573 defsubr (&Sround);
574 defsubr (&Struncate);
575}