#include "ruby/ruby.h"
#include <math.h>
#include <errno.h>
Go to the source code of this file.
Defines | |
#define | numberof(array) (int)(sizeof(array) / sizeof((array)[0])) |
#define | Need_Float(x) do {if (TYPE(x) != T_FLOAT) {(x) = rb_to_float(x);}} while(0) |
#define | Need_Float2(x, y) |
#define | domain_error(msg) rb_raise(rb_eMathDomainError, "Numerical argument is out of domain - " #msg); |
#define | exp1(n) |
#define | exp2(n) |
Functions | |
VALUE | rb_to_float (VALUE val) |
static VALUE | math_atan2 (VALUE obj, VALUE y, VALUE x) |
static VALUE | math_cos (VALUE obj, VALUE x) |
static VALUE | math_sin (VALUE obj, VALUE x) |
static VALUE | math_tan (VALUE obj, VALUE x) |
static VALUE | math_acos (VALUE obj, VALUE x) |
static VALUE | math_asin (VALUE obj, VALUE x) |
static VALUE | math_atan (VALUE obj, VALUE x) |
double | cosh (double x) |
static VALUE | math_cosh (VALUE obj, VALUE x) |
double | sinh (double x) |
static VALUE | math_sinh (VALUE obj, VALUE x) |
double | tanh (double x) |
static VALUE | math_tanh (VALUE obj, VALUE x) |
static VALUE | math_acosh (VALUE obj, VALUE x) |
static VALUE | math_asinh (VALUE obj, VALUE x) |
static VALUE | math_atanh (VALUE obj, VALUE x) |
static VALUE | math_exp (VALUE obj, VALUE x) |
static VALUE | math_log (int argc, VALUE *argv) |
double | log2 (double x) |
static VALUE | math_log2 (VALUE obj, VALUE x) |
static VALUE | math_log10 (VALUE obj, VALUE x) |
static VALUE | math_sqrt (VALUE obj, VALUE x) |
static VALUE | math_cbrt (VALUE obj, VALUE x) |
static VALUE | math_frexp (VALUE obj, VALUE x) |
static VALUE | math_ldexp (VALUE obj, VALUE x, VALUE n) |
static VALUE | math_hypot (VALUE obj, VALUE x, VALUE y) |
static VALUE | math_erf (VALUE obj, VALUE x) |
static VALUE | math_erfc (VALUE obj, VALUE x) |
static VALUE | math_gamma (VALUE obj, VALUE x) |
static VALUE | math_lgamma (VALUE obj, VALUE x) |
exp2 (atan2) | |
exp1 (sin) | |
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 28 of file math.c.
Referenced by math_acos(), math_acosh(), math_asin(), math_atan2(), math_atanh(), math_gamma(), math_lgamma(), math_log(), math_log10(), math_log2(), and math_sqrt().
#define exp1 | ( | n | ) |
#define exp2 | ( | n | ) |
#define Need_Float | ( | x | ) | do {if (TYPE(x) != T_FLOAT) {(x) = rb_to_float(x);}} while(0) |
Definition at line 22 of file math.c.
Referenced by math_acos(), math_acosh(), math_asin(), math_asinh(), math_atan(), math_atanh(), math_cbrt(), math_cos(), math_cosh(), math_erf(), math_erfc(), math_exp(), math_frexp(), math_gamma(), math_ldexp(), math_lgamma(), math_log(), math_log10(), math_log2(), math_sin(), math_sinh(), math_sqrt(), math_tan(), and math_tanh().
#define Need_Float2 | ( | x, | ||
y | ||||
) |
do {\ Need_Float(x);\ Need_Float(y);\ } while (0)
Definition at line 23 of file math.c.
Referenced by math_atan2(), and math_hypot().
#define numberof | ( | array | ) | (int)(sizeof(array) / sizeof((array)[0])) |
Definition at line 16 of file math.c.
Referenced by math_gamma().
double cosh | ( | double | x | ) |
Definition at line 167 of file math.c.
Referenced by math_cosh(), and tanh().
exp1 | ( | sin | ) |
Definition at line 732 of file math.c.
References DBL2NUM, 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 720 of file math.c.
References math_log().
double log2 | ( | double | x | ) |
Definition at line 359 of file math.c.
Referenced by math_log2().
Definition at line 119 of file math.c.
References DBL2NUM, domain_error, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 242 of file math.c.
References acosh(), DBL2NUM, domain_error, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 139 of file math.c.
References DBL2NUM, domain_error, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 262 of file math.c.
References asinh(), DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 159 of file math.c.
References DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 52 of file math.c.
References DBL2NUM, domain_error, isinf(), Need_Float2, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 276 of file math.c.
References atanh(), DBL2NUM, domain_error, INFINITY, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 494 of file math.c.
References cbrt(), DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 73 of file math.c.
References DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 181 of file math.c.
References cosh(), DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 566 of file math.c.
References DBL2NUM, erf(), Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 580 of file math.c.
References DBL2NUM, erfc(), Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 304 of file math.c.
References DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 513 of file math.c.
References DBL2NUM, INT2NUM(), Need_Float, rb_assoc_new(), and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 627 of file math.c.
References DBL2NUM, domain_error, isinf(), Need_Float, numberof, RFLOAT_VALUE, signbit(), and tgamma().
Referenced by exp1().
Definition at line 552 of file math.c.
References DBL2NUM, hypot(), Need_Float2, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 535 of file math.c.
References DBL2NUM, Need_Float, NUM2INT, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 688 of file math.c.
References DBL2NUM, domain_error, INFINITY, INT2FIX, isinf(), lgamma_r(), Need_Float, rb_assoc_new(), RFLOAT_VALUE, and signbit().
Referenced by exp1().
Definition at line 336 of file math.c.
References DBL2NUM, domain_error, INFINITY, Need_Float, rb_scan_args(), and RFLOAT_VALUE.
Definition at line 409 of file math.c.
References DBL2NUM, domain_error, INFINITY, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 382 of file math.c.
References DBL2NUM, domain_error, INFINITY, log2(), Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 88 of file math.c.
References DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 205 of file math.c.
References DBL2NUM, Need_Float, RFLOAT_VALUE, and sinh().
Referenced by exp1().
Definition at line 448 of file math.c.
References DBL2NUM, domain_error, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 104 of file math.c.
References DBL2NUM, Need_Float, and RFLOAT_VALUE.
Referenced by exp1().
Definition at line 228 of file math.c.
References DBL2NUM, Need_Float, RFLOAT_VALUE, and tanh().
Referenced by exp1().
Definition at line 2284 of file object.c.
References NIL_P, Qfalse, Qtrue, rb_cNumeric, rb_convert_type(), rb_eTypeError, rb_obj_classname(), rb_obj_is_kind_of(), rb_raise(), T_FLOAT, and TYPE.
double sinh | ( | double | x | ) |
Definition at line 190 of file math.c.
Referenced by math_sinh(), and tanh().
double tanh | ( | double | x | ) |