cmath.dll
Code: Alles auswählen
#include <math.h>
void mult(float n, float* r) {
*r=n*3.7;
}
void div(float n, float* r) {
*r=n/2.3;
}
Code: Alles auswählen
>>> from ctypes import *
>>> cmath = cdll.LoadLibrary("cmath.dll")
>>> b = c_float(34.3)
>>> r = ct.pointer(c_float())
>>>
>>> cmath.mult(b,r)
14484904 #<-- das hier, ist eine ähnliche Zahl wie bei dir, vermute das es die Speicheradresse (aber nicht der tatsächliche Wert eben) ist
>>> r.contents
c_float(126.90999603271484)
>>> print r.contents.value
126.909996033
>>> # oder hier mal gerundet auf 2 Nachkommastellen ...
>>> print round(r.contents.value,2)
126.91
>>Masaru<<