Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
Arithmetic conversion between C's double
and Ruby's.
More...
#include "ruby/internal/attr/pure.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Macros | |
#define | NUM2DBL rb_num2dbl |
Old name of rb_num2dbl. More... | |
#define | RFLOAT_VALUE rb_float_value |
Old name of rb_float_value. More... | |
#define | DBL2NUM rb_float_new |
Old name of rb_float_new. More... | |
Functions | |
double | rb_num2dbl (VALUE num) |
Converts an instance of rb_cNumeric into C's double . More... | |
double | rb_float_value (VALUE num) |
Extracts its double value from an instance of rb_cFloat. More... | |
VALUE | rb_float_new (double d) |
Converts a C's double into an instance of rb_cFloat. More... | |
VALUE | rb_float_new_in_heap (double d) |
Identical to rb_float_new(), except it does not generate Flonums. More... | |
Arithmetic conversion between C's double
and Ruby's.
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file double.h.
VALUE rb_float_new | ( | double | d | ) |
Converts a C's double
into an instance of rb_cFloat.
[in] | d | Arbitrary double value. |
Definition at line 6525 of file numeric.c.
Referenced by rb_fiber_scheduler_make_timeout().
VALUE rb_float_new_in_heap | ( | double | d | ) |
Identical to rb_float_new(), except it does not generate Flonums.
[in] | d | Arbitrary double value. |