Ruby  2.5.0dev(2017-10-22revision60238)
Macros | Functions | Variables
math.c File Reference
#include "internal.h"
#include <float.h>
#include <math.h>
#include <errno.h>

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

double cosh (double x)
 
double sinh (double x)
 
double tanh (double x)
 
double log2 (double x)
 
VALUE rb_math_sqrt (VALUE x)
 
 exp2 (atan2)
 
 exp1 (sin)
 
void Init_Math (void)
 

Variables

VALUE rb_mMath
 
VALUE rb_eMathDomainError
 

Macro Definition Documentation

◆ domain_error

#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 tgamma().

◆ exp1

#define exp1 (   n)
Value:
VALUE \
rb_math_##n(VALUE x)\
{\
return math_##n(0, x);\
}
unsigned long VALUE
Definition: ruby.h:85

Definition at line 907 of file math.c.

◆ exp2

#define exp2 (   n)
Value:
VALUE \
rb_math_##n(VALUE x, VALUE y)\
{\
return math_##n(0, x, y);\
}
unsigned long VALUE
Definition: ruby.h:85

Definition at line 914 of file math.c.

◆ f_boolcast

#define f_boolcast (   x)    ((x) ? Qtrue : Qfalse)

Definition at line 608 of file math.c.

◆ Get_Double

#define Get_Double (   x)    rb_num_to_dbl(x)

Definition at line 30 of file math.c.

◆ M_LN10

#define M_LN10   2.30258509299404568401799145468436421

Definition at line 425 of file math.c.

◆ M_LN2

#define M_LN2   0.693147180559945309417232121458176568

Definition at line 422 of file math.c.

◆ RB_BIGNUM_TYPE_P

#define RB_BIGNUM_TYPE_P (   x)    RB_TYPE_P((x), T_BIGNUM)

Definition at line 25 of file math.c.

Function Documentation

◆ cosh()

double cosh ( double  x)

Definition at line 228 of file math.c.

Referenced by tanh().

◆ exp1()

exp1 ( sin  )

◆ exp2()

exp2 ( atan2  )

Definition at line 921 of file math.c.

◆ Init_Math()

void Init_Math ( void  )

Definition at line 1021 of file math.c.

References InitVM.

◆ log2()

double log2 ( double  x)

Definition at line 499 of file math.c.

◆ rb_math_sqrt()

VALUE rb_math_sqrt ( VALUE  x)

Definition at line 627 of file math.c.

References neg, RB_TYPE_P, and T_COMPLEX.

◆ sinh()

double sinh ( double  x)

Definition at line 256 of file math.c.

Referenced by tanh().

◆ tanh()

double tanh ( double  x)

Definition at line 284 of file math.c.

References cosh(), isinf(), and sinh().

Variable Documentation

◆ rb_eMathDomainError

VALUE rb_eMathDomainError

Definition at line 28 of file math.c.

Referenced by exp1().

◆ rb_mMath

VALUE rb_mMath

Definition at line 27 of file math.c.

Referenced by exp1().