Project

General

Profile

Actions

Bug #17318

closed

Raising float to the power of other issue

Added by deXterbed (Manoj Mishra) about 4 years ago. Updated about 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:100779]

Description

Raising a negative float to another float results in a complex number. Interestingly, doing the same thing without using variables works fine!

Sample Snippet:

$ irb
2.6.3 :001 > x=-0.4790529833050308
=> -0.4790529833050308
2.6.3 :002 > y=0.9918032786885246
=> 0.9918032786885246
2.6.3 :003 > xy
=> (-0.48179173935576963+0.012409246172848264i)
2.6.3 :004 > -0.4790529833050308
0.9918032786885246
=> -0.4819515219418196

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0