Ruby  3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
Data Structures | Macros | Functions
complex.h File Reference

(b76ad15ed0da636161de0243c547ee1e6fc95681)

Internal header for Complex. More...

#include "ruby/internal/value.h"
Include dependency graph for complex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RComplex
 

Macros

#define RCOMPLEX(obj)   ((struct RComplex *)(obj))
 
#define RCOMPLEX_SET_REAL(cmp, r)   RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
 
#define RCOMPLEX_SET_IMAG(cmp, i)   RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))
 

Functions

VALUE rb_dbl_complex_new_polar_pi (double abs, double ang)
 
st_index_t rb_complex_hash (VALUE comp)
 

Detailed Description

Internal header for Complex.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Definition in file complex.h.

Macro Definition Documentation

◆ RCOMPLEX

#define RCOMPLEX (   obj)    ((struct RComplex *)(obj))

Definition at line 20 of file complex.h.

◆ RCOMPLEX_SET_IMAG

#define RCOMPLEX_SET_IMAG (   cmp,
 
)    RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))

Definition at line 24 of file complex.h.

◆ RCOMPLEX_SET_REAL

#define RCOMPLEX_SET_REAL (   cmp,
 
)    RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))

Definition at line 23 of file complex.h.

Function Documentation

◆ rb_complex_hash()

st_index_t rb_complex_hash ( VALUE  comp)

Definition at line 1326 of file complex.c.

References get_dat1, NUM2LONG, rb_hash(), and rb_memhash().

Referenced by rb_iseq_cdhash_hash().

◆ rb_dbl_complex_new_polar_pi()

VALUE rb_dbl_complex_new_polar_pi ( double  abs,
double  ang 
)

Definition at line 663 of file complex.c.

References cospi, DBL2NUM, rb_complex_new(), RFLOAT_0, and sinpi.