ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:99143] [Ruby master Bug#17025] `Time#ceil` does not work like `Rational#ceil` or `Float#ceil`
@ 2020-07-13  4:28 gxtan1990
  2020-07-24 22:59 ` [ruby-core:99318] " merch-redmine
  2020-08-05  8:01 ` [ruby-core:99483] " gxtan1990
  0 siblings, 2 replies; 3+ messages in thread
From: gxtan1990 @ 2020-07-13  4:28 UTC (permalink / raw)
  To: ruby-core

Issue #17025 has been reported by tgxworld (Guo Xiang Tan).

----------------------------------------
Bug #17025: `Time#ceil` does not work like `Rational#ceil` or `Float#ceil`
https://bugs.ruby-lang.org/issues/17025

* Author: tgxworld (Guo Xiang Tan)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
## Current behavior

```
irb(main):011:0> time = Time.utc(2016, 4, 23, 0, 0, "0.123456789".to_r)
irb(main):012:0> time.ceil(9)
=> 2016-04-23 00:00:00.12345679 UTC
irb(main):013:0> time.ceil(10)
=> 2016-04-23 00:00:00 1234567891/10000000000 UTC
irb(main):014:0> time.ceil(11)
=> 2016-04-23 00:00:00 12345678901/100000000000 UTC

irb(main):015:0> "0.123456789".to_r.ceil(9)
=> (123456789/1000000000)

irb(main):016:0> "0.123456789".to_f.ceil(9)
=> 0.123456789
```

## Expected Behavior

```
irb(main):011:0> time = Time.utc(2016, 4, 23, 0, 0, "0.123456789".to_r)
irb(main):012:0> time.ceil(9)
=> 2016-04-23 00:00:00.123456789 UTC
irb(main):012:0> time.ceil(10)
=> 2016-04-23 00:00:00.123456789 UTC
irb(main):012:0> time.ceil(11)
=> 2016-04-23 00:00:00.123456789 UTC
```





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:99318] [Ruby master Bug#17025] `Time#ceil` does not work like `Rational#ceil` or `Float#ceil`
  2020-07-13  4:28 [ruby-core:99143] [Ruby master Bug#17025] `Time#ceil` does not work like `Rational#ceil` or `Float#ceil` gxtan1990
@ 2020-07-24 22:59 ` merch-redmine
  2020-08-05  8:01 ` [ruby-core:99483] " gxtan1990
  1 sibling, 0 replies; 3+ messages in thread
From: merch-redmine @ 2020-07-24 22:59 UTC (permalink / raw)
  To: ruby-core

Issue #17025 has been updated by jeremyevans0 (Jeremy Evans).


I've added a pull request to fix this: https://github.com/ruby/ruby/pull/3362 

----------------------------------------
Bug #17025: `Time#ceil` does not work like `Rational#ceil` or `Float#ceil`
https://bugs.ruby-lang.org/issues/17025#change-86713

* Author: tgxworld (Guo Xiang Tan)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
## Current behavior

```
irb(main):011:0> time = Time.utc(2016, 4, 23, 0, 0, "0.123456789".to_r)
irb(main):012:0> time.ceil(9)
=> 2016-04-23 00:00:00.12345679 UTC
irb(main):013:0> time.ceil(10)
=> 2016-04-23 00:00:00 1234567891/10000000000 UTC
irb(main):014:0> time.ceil(11)
=> 2016-04-23 00:00:00 12345678901/100000000000 UTC

irb(main):015:0> "0.123456789".to_r.ceil(9)
=> (123456789/1000000000)

irb(main):016:0> "0.123456789".to_f.ceil(9)
=> 0.123456789
```

## Expected Behavior

```
irb(main):011:0> time = Time.utc(2016, 4, 23, 0, 0, "0.123456789".to_r)
irb(main):012:0> time.ceil(9)
=> 2016-04-23 00:00:00.123456789 UTC
irb(main):012:0> time.ceil(10)
=> 2016-04-23 00:00:00.123456789 UTC
irb(main):012:0> time.ceil(11)
=> 2016-04-23 00:00:00.123456789 UTC
```





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:99483] [Ruby master Bug#17025] `Time#ceil` does not work like `Rational#ceil` or `Float#ceil`
  2020-07-13  4:28 [ruby-core:99143] [Ruby master Bug#17025] `Time#ceil` does not work like `Rational#ceil` or `Float#ceil` gxtan1990
  2020-07-24 22:59 ` [ruby-core:99318] " merch-redmine
@ 2020-08-05  8:01 ` gxtan1990
  1 sibling, 0 replies; 3+ messages in thread
From: gxtan1990 @ 2020-08-05  8:01 UTC (permalink / raw)
  To: ruby-core

Issue #17025 has been updated by tgxworld (Guo Xiang Tan).


Thank you for fixing this Jeremy. 

----------------------------------------
Bug #17025: `Time#ceil` does not work like `Rational#ceil` or `Float#ceil`
https://bugs.ruby-lang.org/issues/17025#change-86935

* Author: tgxworld (Guo Xiang Tan)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
## Current behavior

```
irb(main):011:0> time = Time.utc(2016, 4, 23, 0, 0, "0.123456789".to_r)
irb(main):012:0> time.ceil(9)
=> 2016-04-23 00:00:00.12345679 UTC
irb(main):013:0> time.ceil(10)
=> 2016-04-23 00:00:00 1234567891/10000000000 UTC
irb(main):014:0> time.ceil(11)
=> 2016-04-23 00:00:00 12345678901/100000000000 UTC

irb(main):015:0> "0.123456789".to_r.ceil(9)
=> (123456789/1000000000)

irb(main):016:0> "0.123456789".to_f.ceil(9)
=> 0.123456789
```

## Expected Behavior

```
irb(main):011:0> time = Time.utc(2016, 4, 23, 0, 0, "0.123456789".to_r)
irb(main):012:0> time.ceil(9)
=> 2016-04-23 00:00:00.123456789 UTC
irb(main):012:0> time.ceil(10)
=> 2016-04-23 00:00:00.123456789 UTC
irb(main):012:0> time.ceil(11)
=> 2016-04-23 00:00:00.123456789 UTC
```





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-05  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13  4:28 [ruby-core:99143] [Ruby master Bug#17025] `Time#ceil` does not work like `Rational#ceil` or `Float#ceil` gxtan1990
2020-07-24 22:59 ` [ruby-core:99318] " merch-redmine
2020-08-05  8:01 ` [ruby-core:99483] " gxtan1990

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).