www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Which import lib holds lrintf()?

reply Andrej Mitrovic <none none.none> writes:
import std.c.math : lrintf;

void main()
{
    lrintf(4.0);
}

Error 42: Symbol Undefined _lrintf
--- errorlevel 1
Apr 26 2011
parent reply Jesse Phillips <jessekphillips+D gmail.com> writes:
Andrej Mitrovic Wrote:

 import std.c.math : lrintf;
 
 void main()
 {
     lrintf(4.0);
 }
 
 Error 42: Symbol Undefined _lrintf
 --- errorlevel 1
Just a guess, libm? dmd testfile.d -L-lm m is the C math library for linux right? Windows I don't know.
Apr 27 2011
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I have a hunch that this function is only available on Linux. If
that's so it should maybe be put in a version(linux) statement.

But I just found lrint is in std.math as well so I can actually use that.
Apr 27 2011
parent reply Don <nospam nospam.com> writes:
Andrej Mitrovic wrote:
 I have a hunch that this function is only available on Linux. If
 that's so it should maybe be put in a version(linux) statement.
 
 But I just found lrint is in std.math as well so I can actually use that.
There should be no reason to use anything from c.math.
Apr 28 2011
parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Okay. Some C code used lrintf() so I was trying to find it to port it to D.
Apr 28 2011