Project

General

Profile

Actions

Feature #15609

open

Kernel#sleep returns Float instead of Integer

Added by znz (Kazuhiro NISHIYAMA) almost 6 years ago. Updated over 5 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:91582]

Description

rb_f_sleep uses time() internally, so it always returns Integer even if it called with Float.

https://github.com/ruby/ruby/blob/124957566f041e5c6e8f678dfaf62cae381826dc/process.c#L4840-L4857

I think returning Float is more useful than Integer.
(But I have no real use cases now.)


Files

ruby-changes.patch (2.53 KB) ruby-changes.patch gabewild37 (Gabe Wild), 08/13/2019 04:26 PM
Actions

Also available in: Atom PDF

Like0
Like0