Ruby: internal/complex.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

complex.h
Go to the documentation of this file.
1#ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_COMPLEX_H
12#include "ruby/internal/value.h" /* for struct RBasic */
13
14 struct RComplex {
15 struct RBasic basic;
16 VALUE real;
17 VALUE imag;
18};
19
20#define RCOMPLEX(obj) ((struct RComplex *)(obj))
21
22/* shortcut macro for internal only */
23#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
24#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))
25
26/* complex.c */
27 VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
28 st_index_t rb_complex_hash(VALUE comp);
29
30#endif /* INTERNAL_COMPLEX_H */
rb_complex_hash
st_index_t rb_complex_hash(VALUE comp)
Definition: complex.c:1332
rb_dbl_complex_new_polar_pi
VALUE rb_dbl_complex_new_polar_pi(double abs, double ang)
Definition: complex.c:669
st_index_t
st_data_t st_index_t
Definition: st.h:50
RBasic
Definition: rbasic.h:47
RComplex
Definition: complex.h:14
RComplex::imag
VALUE imag
Definition: complex.h:17
RComplex::real
VALUE real
Definition: complex.h:16
RComplex::basic
struct RBasic basic
Definition: complex.h:15
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38