S
Schüle Daniel
Hello all,
I encountered a strange behaviour
irb(main):041:0* c = Complex(1.0,1.0)
=> Complex(1.0, 1.0)
irb(main):042:0> p = Complex.polar(2**0.5,45.0/360*2*PI)
=> Complex(1.0, 1.0)
irb(main):043:0> c == p
=> false
irb(main):044:0> c_ = Complex(1.0,1.0)
=> Complex(1.0, 1.0)
irb(main):045:0> c_ == c
=> true
irb(main):046:0>
I would strongly expect c and p to be equal
if c would be created from Fixnum's
than the result would be "explainable"
but still
irb(main):047:0* c = Complex(1,1)
=> Complex(1, 1)
Regards, Daniel
I encountered a strange behaviour
irb(main):041:0* c = Complex(1.0,1.0)
=> Complex(1.0, 1.0)
irb(main):042:0> p = Complex.polar(2**0.5,45.0/360*2*PI)
=> Complex(1.0, 1.0)
irb(main):043:0> c == p
=> false
irb(main):044:0> c_ = Complex(1.0,1.0)
=> Complex(1.0, 1.0)
irb(main):045:0> c_ == c
=> true
irb(main):046:0>
I would strongly expect c and p to be equal
if c would be created from Fixnum's
than the result would be "explainable"
but still
irb(main):047:0* c = Complex(1,1)
=> Complex(1, 1)
Regards, Daniel