Ruby: internal/complex.h File Reference

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

Data Structures | Macros | Functions
complex.h File Reference

Internal header for Complex. More...

`#include "ruby/internal/value.h"`

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

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

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,
|  |  | i
| ) |  | RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))

Definition at line 24 of file complex.h.

## ◆ RCOMPLEX_SET_REAL

#define RCOMPLEX_SET_REAL | ( |  | cmp,
|  |  | r
| ) |  | 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 1332 of file complex.c.

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

## ◆ rb_dbl_complex_new_polar_pi()

VALUE rb_dbl_complex_new_polar_pi | ( | double | abs,
|  | double | ang
| ) |  |

Definition at line 669 of file complex.c.

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

Referenced by rb_big_pow(), and rb_float_pow().