Ruby: include/ruby/internal/arithmetic/double.h Source File

Ruby 3.3.7p123 (2025-01-15 revision be31f993d7fa0219d85f7b3c694d454da4ecc10b)

double.h
Go to the documentation of this file.
1#ifndef RBIMPL_ARITHMETIC_DOUBLE_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ARITHMETIC_DOUBLE_H
23#include "ruby/internal/attr/pure.h"
24#include "ruby/internal/dllexport.h"
25#include "ruby/internal/value.h"
26
27#define NUM2DBL rb_num2dbl
28#define RFLOAT_VALUE rb_float_value
29#define DBL2NUM rb_float_new
30
31 RBIMPL_SYMBOL_EXPORT_BEGIN()
39double rb_num2dbl(VALUE num);
40
41 RBIMPL_ATTR_PURE()
49double rb_float_value(VALUE num);
50
57 VALUE rb_float_new(double d);
58
69 VALUE rb_float_new_in_heap(double d);
70 RBIMPL_SYMBOL_EXPORT_END()
71
72#endif /* RBIMPL_ARITHMETIC_DOUBLE_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
rb_float_new_in_heap
VALUE rb_float_new_in_heap(double d)
Identical to rb_float_new(), except it does not generate Flonums.
Definition numeric.c:1019
rb_num2dbl
double rb_num2dbl(VALUE num)
Converts an instance of rb_cNumeric into C's double.
Definition object.c:3639
pure.h
Defines RBIMPL_ATTR_PURE.
RBIMPL_ATTR_PURE
#define RBIMPL_ATTR_PURE()
Wraps (or simulates) __attribute__((pure))
Definition pure.h:33
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40