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