Yes, GCC and Visual Studio C ++ have different long double types. When generating GCC code for x86, a long double is an 80-bit format with an extended IEEE 754 (*), while Visual Studio C ++ treats a long double as a 64-bit IEEE 754 format with double precision (*).
Thus, (long double)t does not have to be the same number on both platforms, and the division is not the same. Although you noted your question "integer-division", this is a floating point separation between different types of floating point.
(*) almost: it behaves very much like the 79-bit IEEE 754 type with 15 exponential bits and 63 significant bits, but it has a slightly wider range of exponents, since it uses an explicit bit for leading 1 in value.
(**) almost: since the compiler generates instructions that use historical x87 instructions after setting x87 for 53-bit values, denormal results can be double rounded ( link ).
source share