Talk:Fortran/Mixing languages

can someone add instructions for how to do this in the opposite direction? (using bits of C code in a fortran program) 82.13.80.230 (talk) 23:05, 9 June 2008 (UTC)

The mapping between Fortran and C data types is not correct for every architecture. For example, long int is a 4 byte integer on i386 but an 8 byte integer on amd64. long double is even more intricate. On i386 it is a 10 byte float (extended precision from i387), on amd64 it is also a 10 byte float but stored in a 16 byte area of memory. Other architectures might use long double for IEEE quadruple precision numbers or a non-standard way of implementing higher precision than double. On AIX on PowerPC using the XLC compiler, long double is identical to double. Using special compiler flags long double is interpreted as to separate 64 bit floats that must be added to yield the total result, effectively doubling the size of the mantissa. While there is no easy portable way of mapping Fortran and C floats, integers can be easily mapped using C99's integer types (int16_t, int32_t, etc.) --46.128.18.193 (talk) 23:35, 12 November 2010 (UTC)