Ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd)
|
#include "ruby/config.h"
#include <math.h>
#include "internal.h"
#include "id.h"
#include "ruby_assert.h"
#include <ctype.h>
Go to the source code of this file.
Macros | |
#define | NDEBUG |
#define | ZERO INT2FIX(0) |
#define | ONE INT2FIX(1) |
#define | TWO INT2FIX(2) |
#define | RFLOAT_0 DBL2NUM(0) |
#define | id_to_i idTo_i |
#define | id_to_r idTo_r |
#define | id_negate idUMinus |
#define | id_expt idPow |
#define | id_to_f idTo_f |
#define | id_quo idQuo |
#define | id_fdiv idFdiv |
#define | f_boolcast(x) ((x) ? Qtrue : Qfalse) |
#define | fun1(n) |
#define | fun2(n) |
#define | PRESERVE_SIGNEDZERO |
#define | f_positive_p(x) (!f_negative_p(x)) |
#define | f_nonzero_p(x) (!f_zero_p(x)) |
#define | k_exact_p(x) (!RB_FLOAT_TYPE_P(x)) |
#define | k_exact_zero_p(x) (k_exact_p(x) && f_zero_p(x)) |
#define | get_dat1(x) struct RComplex *dat = RCOMPLEX(x) |
#define | get_dat2(x, y) struct RComplex *adat = RCOMPLEX(x), *bdat = RCOMPLEX(y) |
#define | canonicalization 0 |
#define | imp1(n) |
#define | rb_raise_zerodiv() rb_raise(rb_eZeroDivError, "divided by 0") |
#define | nucomp_quo rb_complex_div |
#define | FINITE_TYPE_P(v) (RB_INTEGER_TYPE_P(v) || RB_TYPE_P(v, T_RATIONAL)) |
#define | rb_intern(str) rb_intern_const(str) |
Functions | |
fun1 (to_r) | |
fun2 (expt) | |
VALUE | rb_flo_is_finite_p (VALUE num) |
VALUE | rb_flo_is_infinite_p (VALUE num) |
imp1 (cos) | |
imp1 (sin) | |
VALUE | rb_dbl_complex_new_polar_pi (double abs, double ang) |
VALUE | rb_complex_real (VALUE self) |
VALUE | rb_complex_imag (VALUE self) |
VALUE | rb_complex_uminus (VALUE self) |
VALUE | rb_complex_plus (VALUE self, VALUE other) |
VALUE | rb_complex_minus (VALUE self, VALUE other) |
VALUE | rb_complex_mul (VALUE self, VALUE other) |
VALUE | rb_complex_div (VALUE self, VALUE other) |
VALUE | rb_complex_pow (VALUE self, VALUE other) |
VALUE | rb_complex_abs (VALUE self) |
VALUE | rb_complex_arg (VALUE self) |
VALUE | rb_complex_conjugate (VALUE self) |
VALUE | rb_complex_raw (VALUE x, VALUE y) |
VALUE | rb_complex_new (VALUE x, VALUE y) |
VALUE | rb_complex_new_polar (VALUE x, VALUE y) |
VALUE | rb_complex_polar (VALUE x, VALUE y) |
VALUE | rb_Complex (VALUE x, VALUE y) |
VALUE | rb_dbl_complex_new (double real, double imag) |
Creates a Complex object. More... | |
void | Init_Complex (void) |
Variables | |
VALUE | rb_cComplex |
#define FINITE_TYPE_P | ( | v | ) | (RB_INTEGER_TYPE_P(v) || RB_TYPE_P(v, T_RATIONAL)) |
#define fun1 | ( | n | ) |
#define fun2 | ( | n | ) |
#define imp1 | ( | n | ) |
#define k_exact_p | ( | x | ) | (!RB_FLOAT_TYPE_P(x)) |
#define nucomp_quo rb_complex_div |
#define rb_intern | ( | str | ) | rb_intern_const(str) |
#define rb_raise_zerodiv | ( | ) | rb_raise(rb_eZeroDivError, "divided by 0") |
fun2 | ( | expt | ) |
Definition at line 286 of file complex.c.
References id_quo, rb_float_div(), RB_FLOAT_TYPE_P, rb_funcallv, RB_INTEGER_TYPE_P, rb_numeric_quo(), RB_TYPE_P, and T_RATIONAL.
imp1 | ( | cos | ) |
Definition at line 579 of file complex.c.
References rb_math_log().
imp1 | ( | sin | ) |
Definition at line 1208 of file complex.c.
References get_dat1, and rb_math_atan2().
Definition at line 948 of file complex.c.
Referenced by rb_numeric_quo().
Definition at line 1527 of file complex.c.
Referenced by rb_dbl_complex_new_polar_pi().
Definition at line 1533 of file complex.c.
Referenced by rb_complex_polar().
Definition at line 1539 of file complex.c.
References rb_complex_new_polar().
Definition at line 985 of file complex.c.
Referenced by rb_num_pow().
Definition at line 1521 of file complex.c.
Referenced by rb_dbl_complex_new().
Creates a Complex object.
real | real part value |
imag | imaginary part value |
Definition at line 1561 of file complex.c.
References DBL2NUM, and rb_complex_raw().
Definition at line 667 of file complex.c.
References abs(), cos(), DBL2NUM, M_PI, modf(), rb_complex_new(), RFLOAT_0, and sin().
Referenced by rb_big_pow(), and rb_float_pow().