Ruby
2.4.2p198(2017-09-14revision59899)
|
Go to the source code of this file.
Macros | |
#define | RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM) |
#define | Get_Double(x) rb_num_to_dbl(x) |
#define | domain_error(msg) rb_raise(rb_eMathDomainError, "Numerical argument is out of domain - " #msg) |
#define | M_LN2 0.693147180559945309417232121458176568 |
#define | M_LN10 2.30258509299404568401799145468436421 |
#define | f_boolcast(x) ((x) ? Qtrue : Qfalse) |
#define | exp1(n) |
#define | exp2(n) |
Functions | |
static VALUE | math_atan2 (VALUE unused_obj, VALUE y, VALUE x) |
static VALUE | math_cos (VALUE unused_obj, VALUE x) |
static VALUE | math_sin (VALUE unused_obj, VALUE x) |
static VALUE | math_tan (VALUE unused_obj, VALUE x) |
static VALUE | math_acos (VALUE unused_obj, VALUE x) |
static VALUE | math_asin (VALUE unused_obj, VALUE x) |
static VALUE | math_atan (VALUE unused_obj, VALUE x) |
double | cosh (double x) |
static VALUE | math_cosh (VALUE unused_obj, VALUE x) |
double | sinh (double x) |
static VALUE | math_sinh (VALUE unused_obj, VALUE x) |
double | tanh (double x) |
static VALUE | math_tanh (VALUE unused_obj, VALUE x) |
static VALUE | math_acosh (VALUE unused_obj, VALUE x) |
static VALUE | math_asinh (VALUE unused_obj, VALUE x) |
static VALUE | math_atanh (VALUE unused_obj, VALUE x) |
static VALUE | math_exp (VALUE unused_obj, VALUE x) |
static double | math_log1 (VALUE x) |
static VALUE | math_log (int argc, const VALUE *argv, VALUE unused_obj) |
static double | get_double_rshift (VALUE x, size_t *pnumbits) |
double | log2 (double x) |
static VALUE | math_log2 (VALUE unused_obj, VALUE x) |
static VALUE | math_log10 (VALUE unused_obj, VALUE x) |
static VALUE | math_sqrt (VALUE unused_obj, VALUE x) |
static VALUE | f_negative_p (VALUE x) |
static VALUE | f_signbit (VALUE x) |
VALUE | rb_math_sqrt (VALUE x) |
static VALUE | math_cbrt (VALUE unused_obj, VALUE x) |
static VALUE | math_frexp (VALUE unused_obj, VALUE x) |
static VALUE | math_ldexp (VALUE unused_obj, VALUE x, VALUE n) |
static VALUE | math_hypot (VALUE unused_obj, VALUE x, VALUE y) |
static VALUE | math_erf (VALUE unused_obj, VALUE x) |
static VALUE | math_erfc (VALUE unused_obj, VALUE x) |
static VALUE | math_gamma (VALUE unused_obj, VALUE x) |
static VALUE | math_lgamma (VALUE unused_obj, VALUE x) |
exp2 (atan2) | |
exp1 (sin) | |
void | Init_Math (void) |
Variables | |
VALUE | rb_mMath |
VALUE | rb_eMathDomainError |
#define domain_error | ( | msg | ) | rb_raise(rb_eMathDomainError, "Numerical argument is out of domain - " #msg) |
Definition at line 32 of file math.c.
Referenced by math_acos(), math_acosh(), math_asin(), math_atanh(), math_gamma(), math_lgamma(), math_log1(), math_log10(), math_log2(), and rb_math_sqrt().
#define exp1 | ( | n | ) |
#define exp2 | ( | n | ) |
Definition at line 601 of file math.c.
Referenced by f_negative_p(), and f_signbit().
#define Get_Double | ( | x | ) | rb_num_to_dbl(x) |
Definition at line 30 of file math.c.
Referenced by get_double_rshift(), math_acos(), math_acosh(), math_asin(), math_asinh(), math_atan(), math_atan2(), math_atanh(), math_cbrt(), math_cos(), math_cosh(), math_erf(), math_erfc(), math_exp(), math_frexp(), math_gamma(), math_hypot(), math_ldexp(), math_lgamma(), math_sin(), math_sinh(), math_tan(), math_tanh(), and rb_math_sqrt().
#define M_LN2 0.693147180559945309417232121458176568 |
Definition at line 422 of file math.c.
Referenced by math_log1().
Definition at line 25 of file math.c.
Referenced by get_double_rshift().
double cosh | ( | double | x | ) |
Definition at line 228 of file math.c.
Referenced by math_cosh(), and tanh().
exp1 | ( | sin | ) |
Definition at line 951 of file math.c.
References DBL2NUM, M_PI, math_acos(), math_acosh(), math_asin(), math_asinh(), math_atan(), math_atan2(), math_atanh(), math_cbrt(), math_cos(), math_cosh(), math_erf(), math_erfc(), math_exp(), math_frexp(), math_gamma(), math_hypot(), math_ldexp(), math_lgamma(), math_log(), math_log10(), math_log2(), math_sin(), math_sinh(), math_sqrt(), math_tan(), math_tanh(), rb_define_class_under(), rb_define_const(), rb_define_module(), rb_define_module_function(), rb_eMathDomainError, rb_eStandardError, and rb_mMath.
exp2 | ( | atan2 | ) |
Definition at line 939 of file math.c.
References math_log().
Definition at line 603 of file math.c.
References f_boolcast, FIX2LONG, FIXNUM_P, INT2FIX, and rb_funcall().
Referenced by f_signbit().
Definition at line 610 of file math.c.
References f, f_boolcast, f_negative_p(), isnan, RB_TYPE_P, RFLOAT_VALUE, signbit(), and T_FLOAT.
Referenced by rb_math_sqrt().
|
static |
Definition at line 466 of file math.c.
References BIGNUM_POSITIVE_P, DBL_MANT_DIG, DBL_MAX_EXP, Get_Double, NULL, rb_absint_numwords(), rb_big_rshift(), RB_BIGNUM_TYPE_P, and SIZET2NUM.
Referenced by math_log1(), math_log10(), and math_log2().
double log2 | ( | double | x | ) |
Definition at line 499 of file math.c.
Referenced by math_log2().
Definition at line 173 of file math.c.
References DBL2NUM, domain_error, and Get_Double.
Referenced by exp1().
Definition at line 332 of file math.c.
References acosh(), DBL2NUM, domain_error, and Get_Double.
Referenced by exp1().
Definition at line 197 of file math.c.
References DBL2NUM, domain_error, and Get_Double.
Referenced by exp1().
Definition at line 377 of file math.c.
References atanh(), DBL2NUM, domain_error, Get_Double, and INFINITY.
Referenced by exp1().
Definition at line 693 of file math.c.
References DBL2NUM, Get_Double, INT2NUM, and rb_assoc_new().
Referenced by exp1().
Definition at line 850 of file math.c.
References DBL2NUM, domain_error, Get_Double, isinf(), numberof, signbit(), and tgamma().
Referenced by exp1().
Definition at line 909 of file math.c.
References DBL2NUM, domain_error, Get_Double, INFINITY, INT2FIX, isinf(), lgamma_r(), rb_assoc_new(), and signbit().
Referenced by exp1().
Definition at line 452 of file math.c.
References DBL2NUM, math_log1(), and rb_scan_args().
|
static |
Definition at line 483 of file math.c.
References domain_error, get_double_rshift(), INFINITY, and M_LN2.
Referenced by math_log().
Definition at line 556 of file math.c.
References DBL2NUM, domain_error, get_double_rshift(), and INFINITY.
Referenced by exp1().
Definition at line 526 of file math.c.
References DBL2NUM, domain_error, get_double_rshift(), INFINITY, and log2().
Referenced by exp1().
Definition at line 620 of file math.c.
References DBL2NUM, domain_error, f_signbit(), Get_Double, neg, rb_complex_abs(), rb_complex_new(), RB_TYPE_P, RCOMPLEX, and T_COMPLEX.
Referenced by math_sqrt().
double sinh | ( | double | x | ) |
Definition at line 256 of file math.c.
Referenced by math_sinh(), and tanh().
double tanh | ( | double | x | ) |