ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:69699] [Ruby trunk - Bug #11293] [Open] Integer('0123') => 83
       [not found] <redmine.issue-11293.20150622150243@ruby-lang.org>
@ 2015-06-22 15:02 ` liveloveprosper
  2015-06-22 15:20 ` [ruby-core:69700] [Ruby trunk - Bug #11293] " merch-redmine
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: liveloveprosper @ 2015-06-22 15:02 UTC (permalink / raw)
  To: ruby-core

Issue #11293 has been reported by Matt Di Pasquale.

----------------------------------------
Bug #11293: Integer('0123') => 83
https://bugs.ruby-lang.org/issues/11293

* Author: Matt Di Pasquale
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Is this the correct behavior?

    irb(main):001:0> Integer('0123')
    => 83

Shouldn't the return value be `123`?



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

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

* [ruby-core:69700] [Ruby trunk - Bug #11293] Integer('0123') => 83
       [not found] <redmine.issue-11293.20150622150243@ruby-lang.org>
  2015-06-22 15:02 ` [ruby-core:69699] [Ruby trunk - Bug #11293] [Open] Integer('0123') => 83 liveloveprosper
@ 2015-06-22 15:20 ` merch-redmine
  2015-06-22 22:54 ` [ruby-core:69706] [Ruby trunk - Bug #11293] [Rejected] " nobu
  2017-01-28 16:47 ` [ruby-core:79295] [Ruby trunk Bug#11293] " liveloveprosper
  3 siblings, 0 replies; 4+ messages in thread
From: merch-redmine @ 2015-06-22 15:20 UTC (permalink / raw)
  To: ruby-core

Issue #11293 has been updated by Jeremy Evans.


Matt Di Pasquale wrote:
> Is this the correct behavior?
> 
>     irb(main):001:0> Integer('0123')
>     => 83
> 
> Shouldn't the return value be `123`?

No, 83 would be the expected result, just as if you specified 0123 in ruby code.  Kernel#Integer treats a leading 0 to mean octal, leading 0x to mean hexidecimal, and leading 0b to mean binary, just as ruby itself does.



----------------------------------------
Bug #11293: Integer('0123') => 83
https://bugs.ruby-lang.org/issues/11293#change-53078

* Author: Matt Di Pasquale
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Is this the correct behavior?

    irb(main):001:0> Integer('0123')
    => 83

Shouldn't the return value be `123`?



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

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

* [ruby-core:69706] [Ruby trunk - Bug #11293] [Rejected] Integer('0123') => 83
       [not found] <redmine.issue-11293.20150622150243@ruby-lang.org>
  2015-06-22 15:02 ` [ruby-core:69699] [Ruby trunk - Bug #11293] [Open] Integer('0123') => 83 liveloveprosper
  2015-06-22 15:20 ` [ruby-core:69700] [Ruby trunk - Bug #11293] " merch-redmine
@ 2015-06-22 22:54 ` nobu
  2017-01-28 16:47 ` [ruby-core:79295] [Ruby trunk Bug#11293] " liveloveprosper
  3 siblings, 0 replies; 4+ messages in thread
From: nobu @ 2015-06-22 22:54 UTC (permalink / raw)
  To: ruby-core

Issue #11293 has been updated by Nobuyoshi Nakada.

Status changed from Open to Rejected

Try `Integer('0123', 10)`.

----------------------------------------
Bug #11293: Integer('0123') => 83
https://bugs.ruby-lang.org/issues/11293#change-53083

* Author: Matt Di Pasquale
* Status: Rejected
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Is this the correct behavior?

    irb(main):001:0> Integer('0123')
    => 83

Shouldn't the return value be `123`?



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

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

* [ruby-core:79295] [Ruby trunk Bug#11293] Integer('0123') => 83
       [not found] <redmine.issue-11293.20150622150243@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2015-06-22 22:54 ` [ruby-core:69706] [Ruby trunk - Bug #11293] [Rejected] " nobu
@ 2017-01-28 16:47 ` liveloveprosper
  3 siblings, 0 replies; 4+ messages in thread
From: liveloveprosper @ 2017-01-28 16:47 UTC (permalink / raw)
  To: ruby-core

Issue #11293 has been updated by Matthew Di Pasquale.


Got it. Thank you. :-)

----------------------------------------
Bug #11293: Integer('0123') => 83
https://bugs.ruby-lang.org/issues/11293#change-62708

* Author: Matthew Di Pasquale
* Status: Rejected
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Is this the correct behavior?

    irb(main):001:0> Integer('0123')
    => 83

Shouldn't the return value be `123`?



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

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

end of thread, other threads:[~2017-01-28 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-11293.20150622150243@ruby-lang.org>
2015-06-22 15:02 ` [ruby-core:69699] [Ruby trunk - Bug #11293] [Open] Integer('0123') => 83 liveloveprosper
2015-06-22 15:20 ` [ruby-core:69700] [Ruby trunk - Bug #11293] " merch-redmine
2015-06-22 22:54 ` [ruby-core:69706] [Ruby trunk - Bug #11293] [Rejected] " nobu
2017-01-28 16:47 ` [ruby-core:79295] [Ruby trunk Bug#11293] " liveloveprosper

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).