Ruby: include/ruby/internal/intern/rational.h Source File

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

rational.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_RATIONAL_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_RATIONAL_H
23#include "ruby/internal/dllexport.h"
24#include "ruby/internal/value.h"
25#include "ruby/internal/arithmetic/long.h" /* INT2FIX is here. */
26
27 RBIMPL_SYMBOL_EXPORT_BEGIN()
28
29/* rational.c */
30 VALUE rb_rational_raw(VALUE, VALUE);
31#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
32#define rb_rational_raw2(x,y) rb_rational_raw((x), (y))
33 VALUE rb_rational_new(VALUE, VALUE);
34#define rb_rational_new1(x) rb_rational_new((x), INT2FIX(1))
35#define rb_rational_new2(x,y) rb_rational_new((x), (y))
36 VALUE rb_Rational(VALUE, VALUE);
37#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
38#define rb_Rational2(x,y) rb_Rational((x), (y))
39 VALUE rb_rational_num(VALUE rat);
40 VALUE rb_rational_den(VALUE rat);
41 VALUE rb_flt_rationalize_with_prec(VALUE, VALUE);
42 VALUE rb_flt_rationalize(VALUE);
43
44 RBIMPL_SYMBOL_EXPORT_END()
45
46#endif /* RBIMPL_INTERN_RATIONAL_H */
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
rb_Rational
VALUE rb_Rational(VALUE, VALUE)
Definition: rational.c:1968
rb_flt_rationalize_with_prec
VALUE rb_flt_rationalize_with_prec(VALUE, VALUE)
Definition: rational.c:2231
rb_flt_rationalize
VALUE rb_flt_rationalize(VALUE)
Definition: rational.c:2247
rb_rational_raw
VALUE rb_rational_raw(VALUE, VALUE)
Definition: rational.c:1948
rb_rational_num
VALUE rb_rational_num(VALUE rat)
Definition: rational.c:1977
rb_rational_new
VALUE rb_rational_new(VALUE, VALUE)
Definition: rational.c:1962
rb_rational_den
VALUE rb_rational_den(VALUE rat)
Definition: rational.c:1983
long.h
Arithmetic conversion between C's long and Ruby's.
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38