#include /* C version of code in Lecture 3 * * What is this code 'meant' to do? * What does this code 'actually' do? * * * Compile: here are two different 'ways' to compile the code * * "normal compilation": * gcc -o float2 float2.c * * "different compilation": * gcc -mfpmath=387 -o float2 float2.c * -- the extra option tells the compiler to" * * Use the standard 387 floating-point coprocessor present on * the majority of chips and emulated otherwise. Code compiled * with this option runs almost everywhere. The temporary results * are computed in 80-bit precision instead of the precision * specified by the type, resulting in slightly different results * compared to most of other chips. * See -ffloat-store for more detailed description. * * (description taken from the man page for gcc) * * * Run: ./float2 */ int main(void) { float x = 123456789.0; printf("%f + 1 = %f\n", x, x + 1); return 0; }