2020-04-10 08:11:40 +03:00
|
|
|
#ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/
|
|
|
|
#define INTERNAL_COMPLEX_H
|
|
|
|
/**
|
2020-04-08 07:28:13 +03:00
|
|
|
* @author Ruby developers <ruby-core@ruby-lang.org>
|
2019-11-29 09:18:34 +03:00
|
|
|
* @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.
|
2020-04-08 07:28:13 +03:00
|
|
|
* @brief Internal header for Complex.
|
2019-11-29 09:18:34 +03:00
|
|
|
*/
|
2020-05-08 12:31:09 +03:00
|
|
|
#include "ruby/internal/value.h" /* for struct RBasic */
|
2019-11-29 09:18:34 +03:00
|
|
|
|
|
|
|
struct RComplex {
|
|
|
|
struct RBasic basic;
|
|
|
|
VALUE real;
|
|
|
|
VALUE imag;
|
|
|
|
};
|
|
|
|
|
2020-07-22 08:44:25 +03:00
|
|
|
#define RCOMPLEX(obj) ((struct RComplex *)(obj))
|
2019-11-29 09:18:34 +03:00
|
|
|
|
|
|
|
/* shortcut macro for internal only */
|
2019-12-03 08:47:38 +03:00
|
|
|
#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))
|
2019-11-29 09:18:34 +03:00
|
|
|
|
|
|
|
/* complex.c */
|
|
|
|
VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
|
2021-05-07 06:49:32 +03:00
|
|
|
st_index_t rb_complex_hash(VALUE comp);
|
2019-11-29 09:18:34 +03:00
|
|
|
|
|
|
|
#endif /* INTERNAL_COMPLEX_H */
|