[ruby-core:115050] [Ruby master Bug#19926] Range#size returns an incorrect result for ranges with a Rational endpoint
From:
"kyanagi (Kouhei Yanagita) via ruby-core" <ruby-core@...>
Date:
2023-10-13 23:59:52 UTC
List:
ruby-core #115050
Issue #19926 has been updated by kyanagi (Kouhei Yanagita).
I made a fix: https://github.com/ruby/ruby/pull/8660
----------------------------------------
Bug #19926: Range#size returns an incorrect result for ranges with a Rational endpoint
https://bugs.ruby-lang.org/issues/19926#change-104924
* Author: kyanagi (Kouhei Yanagita)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0dev (2023-10-12T17:32:45Z master 81399a5c46) [arm64-darwin22]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
```
% ~/tmp/ruby-master/bin/ruby -e '(1...3.1r).each { p _1 }'
1
2
3
```
```
% ~/tmp/ruby-master/bin/ruby -e 'p (1...3.1r).size'
2
```
```
% ~/tmp/ruby-master/bin/ruby -e 'p (1...3.1).size'
3
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/