Project

General

Profile

Feature #15609

Kernel#sleep returns Float instead of Integer

Added by znz (Kazuhiro NISHIYAMA) 4 months ago.

Status:
Open
Priority:
Normal
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.)

Also available in: Atom PDF