Float to C double

Bruno Luca lethalman88 at gmail.com
Wed Jun 14 20:14:21 UTC 2006


On Wed, 14 Jun 2006 22:09:17 +0200, Bert Freudenberg <bert at impara.de>  
wrote:

> Am 14.06.2006 um 21:34 schrieb Bruno Luca:
>
>> On Wed, 14 Jun 2006 20:55:07 +0200, Bert Freudenberg <bert at impara.de>  
>> wrote:
>>
>>> Yes. Squeak Floats are double precision IEEE numbers
>>
>> So if i need to pass a C float i need to call the primitive with a  
>> FloatArray?
>
> No. In the case of FFI, it converts from Squeak Floats to doubles or  
> floats as necessary depending on the ffi function declaration. If you  
> write a plugin, you just read a double from the stack and call the  
> function with a float, the conversion is inserted by the C compiler.
>
> - Bert -
>
>

I'm using this syntax:
primitiveBla: aFloat boh: aDouble
	self primitive: 'primitiveBla' parameters: #(Float Float)

Is that ok? What about converting a double to a FloatObj?

-- 
www.lethalman.net - Thoughts about internet technologies



More information about the Squeak-dev mailing list