#1284: Integer PMC missing math methods
--------------------+-------------------------------------------------------
 Reporter:  coke    |       Owner:       
     Type:  RFC     |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  none    |     Version:  trunk
 Severity:  medium  |    Keywords:       
     Lang:          |       Patch:       
 Platform:          |  
--------------------+-------------------------------------------------------
 IMO, this code:

 {{{
 .sub main
   $P1 = box 1.0
   $N1 = $P1.'exp'()
   say $N1
   $P1 = box 1
   $N1 = $P1.'exp'()
   say $N1
 .end
 }}}

 should print
 2.71828182845905
 2.71828182845905

 ... but it dies with:

 {{{
 2.71828182845905
 Method 'exp' not found for invocant of class 'Integer'
 }}}

 Clearly, exp isn't defined on Integer, but IMO, all the math methods
 defined on Float should be defined on Integer. (otherwise, given an
 arbitrary numeric PMC, we have to jump through hoops.

 (Alternatively, we can remove these methods from the Float PMC and rely on
 the opcodes.)

 This becomes even more confusing when you take in the morphing of the core
 types - a PMC that was a Float can morph into an Integer which is then
 unable to invoke the various methods.

 This issue was originally opened as
 http://rt.perl.org/rt3/Ticket/Display.html?id=38896

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1284>
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