Hello everybody,
I'm having trouble passing floating point numbers to and from foreign
functions.

This is what I'm doing:

-- test.scm --

(require-extension easyffi)
(print ((foreign-lambda float "testGet")))
((foreign-lambda void "testSet" float) 4.0)
(print ((foreign-lambda float "testGet")))

-- wrapper.c --

float a = 5.0;
void testSet(float value) { a = value; }
float testGet(void) { return a; }

What I get is this:

> csc -X easyffi wrapper.c test.scm
> ./test
-1080529876.0
-1080533140.0

But I expected the output to be:
4.0
5.0

I'm I doing something wrong/forgetting something?
When I use integers instead of floats I do get the desired result.

Thank you in advance,
Righard
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to