[#62297] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap. — Eric Wong <normalperson@...>
nari@ruby-lang.org wrote:
7 messages
2014/05/02
[#62307] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
— SASADA Koichi <ko1@...>
2014/05/03
(2014/05/03 4:41), Eric Wong wrote:
[#62402] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
— Eric Wong <normalperson@...>
2014/05/05
SASADA Koichi <ko1@atdot.net> wrote:
[#62523] [ruby-trunk - Feature #9632] [PATCH 0/2] speedup IO#close with linked-list from ccan — ko1@...
Issue #9632 has been updated by Koichi Sasada.
3 messages
2014/05/11
[#62556] doxygen (Re: Re: [ruby-trunk - Feature #9632] [PATCH 0/2] speedup IO#close with linked-list from ccan) — Tanaka Akira <akr@...>
2014-05-11 8:50 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
3 messages
2014/05/13
[#62727] [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl — Eric Wong <normalperson@...>
rb_unlink_method_entry may cause old_me to be swept before the new
7 messages
2014/05/24
[#63039] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— SASADA Koichi <ko1@...>
2014/06/10
Hi,
[#63077] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— Eric Wong <normalperson@...>
2014/06/10
SASADA Koichi <ko1@atdot.net> wrote:
[#63086] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— SASADA Koichi <ko1@...>
2014/06/11
(2014/06/11 4:47), Eric Wong wrote:
[#63087] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— Eric Wong <normalperson@...>
2014/06/11
SASADA Koichi <ko1@atdot.net> wrote:
[#62862] [RFC] README.EXT: document rb_gc_register_mark_object — Eric Wong <normalperson@...>
Any comment on officially supporting this as part of the C API?
5 messages
2014/05/30
[ruby-core:62637] [ruby-trunk - Feature #9834] Float#{next_float, prev_float}
From:
matz@...
Date:
2014-05-17 07:30:57 UTC
List:
ruby-core #62637
Issue #9834 has been updated by Yukihiro Matsumoto.
Accepted.
Matz.
----------------------------------------
Feature #9834: Float#{next_float,prev_float}
https://bugs.ruby-lang.org/issues/9834#change-46773
* Author: Akira Tanaka
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version:
----------------------------------------
I'd like to add Float#next_float and Float#prev_float which
returns next representable floating-point number and
previous representable floating-point number.
```
p 3.0.next_float #=> 3.0000000000000004
p 3.0.prev_float #=> 2.9999999999999996
```
These methods can be useful to examine the behavior of floating-point numbers.
For example, they can be used to examine floating-point error in 0.1 + 0.1 + ... + 0.1.
```
f = 0.0
100.times { f += 0.1 }
p f #=> 9.99999999999998 # should be 10.0 in the ideal world.
p 10-f #=> 1.9539925233402755e-14 # the floating-point error.
p(10.0.next_float-10) #=> 1.7763568394002505e-15 # 1 ulp (units in the last place).
p((10-f)/(10.0.next_float-10)) #=> 11.0 # the error is 11 ulp.
p "%a" % f #=> "0x1.3fffffffffff5p+3" # the last hex digit is 5. 16 - 5 = 11 ulp.
```
The methods are implemented using nextafter() function described in
IEEE 754 (Appendix), C99 and POSIX.
It seems the function is pretty portable on Unix variants.
However I implemented missing/nextafter.c for environments which don't have the function.
Any idea?
---Files--------------------------------
next_float-and-prev_float.patch (11.9 KB)
--
https://bugs.ruby-lang.org/