public import libc.generated.*;

alias stdin = &__iob_func()[0];
alias stdout = &__iob_func()[1];
alias stderr = &__iob_func()[2];

alias setjmp = _setjmp;
alias random = rand;

alias strtoll = _strtoi64;
alias strtoull = _strtoui64;

// The float variants of math functions are implemented as macros

inline acosf(x:Float) : Float = Float(acos(Double(x)));
inline asinf(x:Float) : Float = Float(asin(Double(x)));
inline atanf(x:Float) : Float = Float(atan(Double(x)));
inline atan2f(x:Float, y:Float) : Float = Float(atan2(Double(x), Double(y)));
inline cosf(x:Float) : Float = Float(cos(Double(x)));
inline coshf(x:Float) : Float = Float(cosh(Double(x)));
inline expf(x:Float) : Float = Float(exp(Double(x)));
inline fabsf(x:Float) : Float = Float(fabs(Double(x)));
inline floorf(x:Float) : Float = Float(floor(Double(x)));
inline fmodf(x:Float, y:Float) : Float = Float(fmod(Double(x), Double(y)));
inline logf(x:Float) : Float = Float(log(Double(x)));
inline log10f(x:Float) : Float = Float(log10(Double(x)));
inline powf(x:Float, y:Float) : Float = Float(pow(Double(x), Double(y)));
inline sinf(x:Float) : Float = Float(sin(Double(x)));
inline sinhf(x:Float) : Float = Float(sinh(Double(x)));
inline sqrtf(x:Float) : Float = Float(sqrt(Double(x)));
inline tanf(x:Float) : Float = Float(tan(Double(x)));
inline tanhf(x:Float) : Float = Float(tanh(Double(x)));

// these are macros

inline isnan(x:Double) : Int = Int(x != x);
inline isnanf(x:Float) : Int = Int(x != x);
