Actions
Bug #8717
closedNegation of a rational/imaginary number literal isn't working
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-08-02 trunk 42320) [x86_64-linux]
Backport:
Description
Hello.
I've found that negation of a rational/imaginary number literal isn't working.
irb(main):001:0> RUBY_DESCRIPTION
=> "ruby 2.1.0dev (2013-08-02 trunk 42320) [x86_64-linux]"
irb(main):002:0> -3r
=> (3/1)
irb(main):003:0> -2i
=> (0+2i)
irb(main):004:0>
The attached file is a patch to fix this bug.
Thanks.
Files
Updated by Anonymous over 11 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r42323.
Takuto, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
-
parse.y (negate_lit): add T_RATIONAL and T_COMPLEX to the switch
statement, and call rb_bug() if an unknown type is passed to
negate_lit(). [ruby-core:56316] [Bug #8717] -
bootstraptest/test_literal_suffix.rb (assert_equal): add test
Actions
Like0
Like0