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
14struct RComplex {
15 struct RBasic basic;
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 */
27VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
29
30#endif /* INTERNAL_COMPLEX_H */
st_index_t rb_complex_hash(VALUE comp)
Definition: complex.c:1332
VALUE rb_dbl_complex_new_polar_pi(double abs, double ang)
Definition: complex.c:669
st_data_t st_index_t
Definition: st.h:50
Definition: rbasic.h:47
VALUE imag
Definition: complex.h:17
VALUE real
Definition: complex.h:16
struct RBasic basic
Definition: complex.h:15
Defines VALUE and ID.
unsigned long VALUE
Definition: value.h:38