Project

General

Profile

Actions

Bug #4655

closed

String#to_c does not support scientific notation

Added by d-snp (Tinco Andringa) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
-
Backport:
[ruby-core:36046]

Description

Specs have been added for this but I did not find an issue for it so I report it here.

Example:

assert_equals('2e3+2e4i'.to_c, Complex(2e3, 2e4))

Updated by d-snp (Tinco Andringa) over 13 years ago

I've submitted a pull request for this bug:

https://github.com/ruby/ruby/pull/16

Updated by mrkn (Kenta Murata) over 13 years ago

  • Assignee set to tadf (tadayoshi funaba)
  • Target version set to 1.9.3

Updated by mrkn (Kenta Murata) over 13 years ago

  • Assignee changed from tadf (tadayoshi funaba) to matz (Yukihiro Matsumoto)

Sorry, I misunderstood that this issue is about Complex, so I assigned this to tadayoshi.
But, correctly, this is about String.
I assign this to matz again.

Updated by matz (Yukihiro Matsumoto) over 13 years ago

  • ruby -v changed from ruby 1.9.3dev (2011-05-05 trunk 31435) [x86_64-darwin10.5.0] to -

Hi,

In message "Re: [ruby-core:36049] [Ruby 1.9 - Bug #4655] String#to_c does not support scientific notation"
on Mon, 9 May 2011 09:32:35 +0900, Kenta Murata writes:

|Issue #4655 has been updated by Kenta Murata.
|
|Assignee changed from tadayoshi funaba to Yukihiro Matsumoto
|
|Sorry, I misunderstood that this issue is about Complex, so I assigned this to tadayoshi.
|But, correctly, this is about String.
|I assign this to matz again.

Go ahead and merge it, if my decision is important.

						matz.

Updated by mrkn (Kenta Murata) over 13 years ago

  • Status changed from Open to Closed

Updated by d-snp (Tinco Andringa) over 13 years ago

Issue #4655 has been updated by Kenta Murata.

Status changed from Open to Closed

Thanks for accepting my patch! :) I'm a bit of a beginner with C, I
plan on submitting patches to bugs I find every now and then. Please
let me know if you have any tips or comments about my code.

To Funaba-san: I saw you replaced my calls to strchr with strpbrk
that's awesome I didn't know that function existed. I also saw you
removed a single line of comment. Are single line comment 'hints'
frowned upon in Ruby? Do they give too much attention to the utter
lack of comments around it? :P

Thank you!
Tinco


Bug #4655: String#to_c does not support scientific notation
http://redmine.ruby-lang.org/issues/4655

Author: Tinco Andringa
Status: Closed
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: core
Target version: 1.9.3
ruby -v: -

Specs have been added for this but I did not find an issue for it so I report it here.

Example:

assert_equals('2e3+2e4i'.to_c, Complex(2e3, 2e4))

--
http://redmine.ruby-lang.org

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0