25 |
object imag_unit, minus_imag_unit, imag_two; |
object imag_unit, minus_imag_unit, imag_two; |
26 |
|
|
27 |
int |
int |
28 |
fixnum_expt(x, y) |
fixnum_expt(int x, int y) |
29 |
{ |
{ |
30 |
int z; |
int z; |
31 |
|
|
42 |
} |
} |
43 |
|
|
44 |
object |
object |
45 |
number_exp(x) |
number_exp(object x) |
|
object x; |
|
46 |
{ |
{ |
47 |
double exp(); |
double exp(double); |
48 |
|
|
49 |
switch (type_of(x)) { |
switch (type_of(x)) { |
50 |
|
|
62 |
case t_complex: |
case t_complex: |
63 |
{ |
{ |
64 |
object y, y1; |
object y, y1; |
65 |
object number_sin(), number_cos(); |
object number_sin(object x), number_cos(object x); |
66 |
vs_mark; |
vs_mark; |
67 |
|
|
68 |
y = x->cmp.cmp_imag; |
y = x->cmp.cmp_imag; |
82 |
|
|
83 |
default: |
default: |
84 |
FEwrong_type_argument(sLnumber, x); |
FEwrong_type_argument(sLnumber, x); |
85 |
|
return(Cnil); |
86 |
} |
} |
87 |
} |
} |
88 |
|
|
89 |
object |
object |
90 |
number_expt(x, y) |
number_expt(object x, object y) |
|
object x, y; |
|
91 |
{ |
{ |
92 |
enum type tx, ty; |
enum type tx, ty; |
93 |
object z, number_nlog(); |
object z, number_nlog(object x); |
94 |
vs_mark; |
vs_mark; |
95 |
|
|
96 |
tx = type_of(x); |
tx = type_of(x); |
160 |
} |
} |
161 |
|
|
162 |
object |
object |
163 |
number_nlog(x) |
number_nlog(object x) |
|
object x; |
|
164 |
{ |
{ |
165 |
double log(); |
double log(double); |
166 |
object r, i, a, p, number_sqrt(), number_atan2(); |
object r=Cnil, i=Cnil, a, p, number_sqrt(object x), number_atan2(object y, object x); |
167 |
vs_mark; |
vs_mark; |
168 |
|
|
169 |
if (type_of(x) == t_complex) { |
if (type_of(x) == t_complex) { |
213 |
} |
} |
214 |
|
|
215 |
object |
object |
216 |
number_log(x, y) |
number_log(object x, object y) |
|
object x, y; |
|
217 |
{ |
{ |
218 |
object z; |
object z; |
219 |
vs_mark; |
vs_mark; |
232 |
} |
} |
233 |
|
|
234 |
object |
object |
235 |
number_sqrt(x) |
number_sqrt(object x) |
|
object x; |
|
236 |
{ |
{ |
237 |
object z; |
object z; |
238 |
double sqrt(); |
double sqrt(double); |
239 |
vs_mark; |
vs_mark; |
240 |
|
|
241 |
if (type_of(x) == t_complex) |
if (type_of(x) == t_complex) |
268 |
} |
} |
269 |
|
|
270 |
object |
object |
271 |
number_atan2(y, x) |
number_atan2(object y, object x) |
|
object y, x; |
|
272 |
{ |
{ |
273 |
object z; |
object z; |
274 |
double atan(), dy, dx, dz; |
double atan(double), dy, dx, dz=0.0; |
275 |
|
|
276 |
dy = number_to_double(y); |
dy = number_to_double(y); |
277 |
dx = number_to_double(x); |
dx = number_to_double(x); |
304 |
} |
} |
305 |
|
|
306 |
object |
object |
307 |
number_atan(y) |
number_atan(object y) |
|
object y; |
|
308 |
{ |
{ |
309 |
object z, z1; |
object z, z1; |
310 |
vs_mark; |
vs_mark; |
332 |
} |
} |
333 |
|
|
334 |
object |
object |
335 |
number_sin(x) |
number_sin(object x) |
|
object x; |
|
336 |
{ |
{ |
337 |
double sin(); |
double sin(double); |
338 |
|
|
339 |
switch (type_of(x)) { |
switch (type_of(x)) { |
340 |
|
|
373 |
|
|
374 |
default: |
default: |
375 |
FEwrong_type_argument(sLnumber, x); |
FEwrong_type_argument(sLnumber, x); |
376 |
|
return(Cnil); |
377 |
|
|
378 |
} |
} |
379 |
} |
} |
380 |
|
|
381 |
object |
object |
382 |
number_cos(x) |
number_cos(object x) |
|
object x; |
|
383 |
{ |
{ |
384 |
double cos(); |
double cos(double); |
385 |
|
|
386 |
switch (type_of(x)) { |
switch (type_of(x)) { |
387 |
|
|
420 |
|
|
421 |
default: |
default: |
422 |
FEwrong_type_argument(sLnumber, x); |
FEwrong_type_argument(sLnumber, x); |
423 |
|
return(Cnil); |
424 |
|
|
425 |
} |
} |
426 |
} |
} |
427 |
|
|
428 |
object |
object |
429 |
number_tan(x) |
number_tan(object x) |
|
object x; |
|
430 |
{ |
{ |
431 |
object r, s, c; |
object r, s, c; |
432 |
vs_mark; |
vs_mark; |
442 |
return(r); |
return(r); |
443 |
} |
} |
444 |
|
|
445 |
Lexp() |
void |
446 |
|
Lexp(void) |
447 |
{ |
{ |
448 |
check_arg(1); |
check_arg(1); |
449 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
450 |
vs_base[0] = number_exp(vs_base[0]); |
vs_base[0] = number_exp(vs_base[0]); |
451 |
} |
} |
452 |
|
|
453 |
Lexpt() |
void |
454 |
|
Lexpt(void) |
455 |
{ |
{ |
456 |
check_arg(2); |
check_arg(2); |
457 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
458 |
check_type_number(&vs_base[1]); |
check_type_number(&vs_base[1]); |
459 |
vs_base[0] = number_expt(vs_base[0], vs_base[1]); |
vs_base[0] = number_expt(vs_base[0], vs_base[1]); |
460 |
vs_pop; |
vs_popp; |
461 |
} |
} |
462 |
|
|
463 |
Llog() |
void |
464 |
|
Llog(void) |
465 |
{ |
{ |
466 |
int narg; |
int narg; |
467 |
|
|
475 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
476 |
check_type_number(&vs_base[1]); |
check_type_number(&vs_base[1]); |
477 |
vs_base[0] = number_log(vs_base[1], vs_base[0]); |
vs_base[0] = number_log(vs_base[1], vs_base[0]); |
478 |
vs_pop; |
vs_popp; |
479 |
} else |
} else |
480 |
too_many_arguments(); |
too_many_arguments(); |
481 |
} |
} |
482 |
|
|
483 |
Lsqrt() |
void |
484 |
|
Lsqrt(void) |
485 |
{ |
{ |
486 |
check_arg(1); |
check_arg(1); |
487 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
488 |
vs_base[0] = number_sqrt(vs_base[0]); |
vs_base[0] = number_sqrt(vs_base[0]); |
489 |
} |
} |
490 |
|
|
491 |
Lsin() |
void |
492 |
|
Lsin(void) |
493 |
{ |
{ |
494 |
check_arg(1); |
check_arg(1); |
495 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
496 |
vs_base[0] = number_sin(vs_base[0]); |
vs_base[0] = number_sin(vs_base[0]); |
497 |
} |
} |
498 |
|
|
499 |
Lcos() |
void |
500 |
|
Lcos(void) |
501 |
{ |
{ |
502 |
check_arg(1); |
check_arg(1); |
503 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
504 |
vs_base[0] = number_cos(vs_base[0]); |
vs_base[0] = number_cos(vs_base[0]); |
505 |
} |
} |
506 |
|
|
507 |
Ltan() |
void |
508 |
|
Ltan(void) |
509 |
{ |
{ |
510 |
check_arg(1); |
check_arg(1); |
511 |
check_type_number(&vs_base[0]); |
check_type_number(&vs_base[0]); |
512 |
vs_base[0] = number_tan(vs_base[0]); |
vs_base[0] = number_tan(vs_base[0]); |
513 |
} |
} |
514 |
|
|
515 |
Latan() |
void |
516 |
|
Latan(void) |
517 |
{ |
{ |
518 |
int narg; |
int narg; |
519 |
|
|
527 |
check_type_or_rational_float(&vs_base[0]); |
check_type_or_rational_float(&vs_base[0]); |
528 |
check_type_or_rational_float(&vs_base[1]); |
check_type_or_rational_float(&vs_base[1]); |
529 |
vs_base[0] = number_atan2(vs_base[0], vs_base[1]); |
vs_base[0] = number_atan2(vs_base[0], vs_base[1]); |
530 |
vs_pop; |
vs_popp; |
531 |
} else |
} else |
532 |
too_many_arguments(); |
too_many_arguments(); |
533 |
} |
} |
534 |
|
|
535 |
init_num_sfun() |
void |
536 |
|
init_num_sfun(void) |
537 |
{ |
{ |
538 |
imag_unit |
imag_unit |
539 |
= make_complex(make_longfloat((longfloat)0.0), |
= make_complex(make_longfloat((longfloat)0.0), |