1 #include <math.h> 2 lrint(double x)3 long lrint(double x) 4 { 5 long r; 6 __asm__ ("cvtsd2si %1, %0" : "=r"(r) : "x"(x)); 7 return r; 8 } 9