comparison src/floatfns.c @ 43413:0f448bd1bf9a

(Fatan): Accept an optional second arg and call atan2 if passed 2 args.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 19 Feb 2002 10:58:07 +0000
parents 004354581e54
children 23a1cea22d13
comparison
equal deleted inserted replaced
43412:ce181770fa8e 43413:0f448bd1bf9a
253 #endif 253 #endif
254 IN_FLOAT (d = asin (d), "asin", arg); 254 IN_FLOAT (d = asin (d), "asin", arg);
255 return make_float (d); 255 return make_float (d);
256 } 256 }
257 257
258 DEFUN ("atan", Fatan, Satan, 1, 1, 0, 258 DEFUN ("atan", Fatan, Satan, 1, 2, 0,
259 doc: /* Return the inverse tangent of ARG. */) 259 doc: /* Return the inverse tangent of the arguments.
260 (arg) 260 If only one argument Y is given, return the inverse tangent of Y.
261 register Lisp_Object arg; 261 If two arguments Y and X are given, return the inverse tangent of Y
262 { 262 divided by X, i.e. the angle in radians between the vector (X, Y)
263 double d = extract_float (arg); 263 and the x-axis. */)
264 IN_FLOAT (d = atan (d), "atan", arg); 264 (y, x)
265 register Lisp_Object y, x;
266 {
267 double d = extract_float (y);
268
269 if (NILP (x))
270 IN_FLOAT (d = atan (d), "atan", y);
271 else
272 {
273 double d2 = extract_float (x);
274
275 IN_FLOAT2 (d = atan2 (d, d2), "atan", y, x);
276 }
265 return make_float (d); 277 return make_float (d);
266 } 278 }
267 279
268 DEFUN ("cos", Fcos, Scos, 1, 1, 0, 280 DEFUN ("cos", Fcos, Scos, 1, 1, 0,
269 doc: /* Return the cosine of ARG. */) 281 doc: /* Return the cosine of ARG. */)