I discovered on my x86 VM (32 bit) that the following program:
#include void foo (long double x) { int y = x; printf(\"(int)%Lf = %d\
Double values, when there is not enough precision to represent a value, rounds up or down to the closest one. In your implementation it is rounding up to 1.