bug in raisedTo:, arctan: primitives

Lee Salzman lsalzman1 at cox.net
Fri Nov 12 01:04:33 PST 2004


Fixed in CVS now.

Lee

On Thu, Nov 11, 2004 at 06:03:20PM -0600, Tim Olson wrote:
> Hi,
> I scanned the Slate email archives, but didn't see anything about this, 
> so I don't know if it is an already known bug or not:
> 
> The raisedTo: and arctan: primitives currently incorrectly set their b 
> value from the first incoming parameter (x) instead of y.  This results 
> in, for example:
> 
> 	2.0 sqrt.
> 	-> 4.0
> 
> The fix is simple (in prims.slate):
> 
> x at FloatTraits raisedTo: y at FloatTraits
> [| z!(Object pointer) a!Float b!Float |
>   z: (CurrentMemory cloneSpecial: FloatProto).
>   a: x pointer arrayElements!(Float pointer) cast load.
>   b: y pointer arrayElements!(Float pointer) cast load.
>   z arrayElements!(Float pointer) cast store: 'pow (a, b)' 
> directly!Float.
>   interpreter stackPush: z asObject
> ] `pidginPrimitive.
> 
> x at FloatTraits arctan: y at FloatTraits
> [| z!(Object pointer) a!Float b!Float |
>   z: (CurrentMemory cloneSpecial: FloatProto).
>   a: x pointer arrayElements!(Float pointer) cast load.
>   b: y pointer arrayElements!(Float pointer) cast load.
>   z arrayElements!(Float pointer) cast store: 'atan2 (a, b)' 
> directly!Float.
>   interpreter stackPush: z asObject
> ] `pidginPrimitive.
> 




More information about the Slate mailing list