Ruby  3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
complex.h
1 #ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/
2 #define INTERNAL_COMPLEX_H
11 #include "ruby/internal/value.h" /* for struct RBasic */
12 
13 struct RComplex {
14  struct RBasic basic;
15  VALUE real;
16  VALUE imag;
17 };
18 
19 #define RCOMPLEX(obj) ((struct RComplex *)(obj))
20 
21 /* shortcut macro for internal only */
22 #define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
23 #define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))
24 
25 /* complex.c */
26 VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
27 st_index_t rb_complex_hash(VALUE comp);
28 
29 #endif /* INTERNAL_COMPLEX_H */
Ruby object's base components.
Definition: rbasic.h:63
Internal header for Complex.
Definition: complex.h:13
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition: value.h:40