#358: complex NaN
--------------------+-------------------------------------------------------
 Reporter:  rurban  |       Owner:  rurban  
     Type:  bug     |      Status:  assigned
 Priority:  normal  |   Milestone:          
Component:  none    |     Version:          
 Severity:  medium  |    Keywords:          
     Lang:          |       Patch:          
 Platform:          |  
--------------------+-------------------------------------------------------

Comment(by rurban):

 Current situation:
 {{{
   $P1=new ["Complex"]
   $P2=new ["Complex"]
   $P1="NaN"
   $P2="i"
   $P2 = mul $P1, $P2
   say $P2
 }}}
 The result is "NaNi", because both parts are treated individually and the
 plus is dropped from i in the printout.

 NaN in the real part will not harm the calculation if the
 imaginary part in non-NaN: NaN+i * 1-2i = NaN-2i

 The string representation of a complex is sprintf("%vg%+vgi", re, im)
 So NaN-2i is "NaN-2i" and NaN+i is printed as "NaNi"

 So NaN * 1i = NaNi

 The proposed is the represent a complex with either the real
 or imaginary part of NaN as "NaN", and do not seperate them.

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/358#comment:3>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to