Project

General

Profile

Actions

Feature #3592

closed

"1.0+0.0i".to_c.to_f can't converted into Float

Added by phasis68 (Heesob Park) almost 14 years ago. Updated about 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:31389]

Description

=begin
Hi,

(1.0+0i).to_f results to 1.0, whereas (1.0+0.0i).to_f generate RangeError.

irb(main):001:0> "1.0+0i".to_c.to_f
=> 1.0
irb(main):002:0> "1.0+0.0i".to_c == 1.0
=> true
irb(main):003:0> "1.0+0.0i".to_c.to_f
RangeError: can't convert 1.0+0.0i into Float
from (irb):3:in to_f' from (irb):3 from c:/usr/bin/irb.bat:20:in '

It would be nice if "1.0+0.0i".to_c.to_f results to 1.0.

Regards,
Park Heesob
=end

Actions #1

Updated by phasis68 (Heesob Park) almost 14 years ago

=begin
This issue was solved with changeset r28725.

Please close this.

=end

Actions #2

Updated by marcandre (Marc-Andre Lafortune) almost 14 years ago

  • Status changed from Open to Closed

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0