bug in raisedTo:, arctan: primitives

Brian Rice water at tunes.org
Fri Nov 12 11:35:51 PST 2004


I've uploaded fixed VM sources to the alpha area. Images with the later 
fixes could not be made yet; I'm still investigating the problem.

On Nov 12, 2004, at 1:04 AM, Lee Salzman wrote:

> 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.
>>
>
>
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/




More information about the Slate mailing list