Re: [pure-lang-users] C float
Status: Beta
Brought to you by:
agraef
From: Eddie R. <er...@bm...> - 2008-08-13 15:03:33
|
On Wed, 2008-08-13 at 16:41 +0200, Albert Graef wrote: > Eddie Rucker wrote: > > If a function is defined in a C library as a float. How are we suppose > > to access it from Pure? > > Ok, this is implemented now. Pure double arguments are truncated to > float, and returned float results are expanded back to Pure doubles > again. E.g.: > > > extern float expf(float); > > expf 1.0; > 2.71828174591064 > Thanks. What about const and unsigned parameters? So far, I've imported stuff like int foo(const char *bob, unsigned int hope) { as extern int foo(char *, int); However, I fear that some arithmetic (division?) on a variable before passing it to foo might get me some big bad ugly bug one day that will be near impossible to track down. e.r. |