• # Chez moi...

    Posté par . En réponse au journal Le Pourquoi Windows plante !. Évalué à 10.

    steve@myhost ~ $ cat test.c
    #include <stdio.h>

    int main() {
    double a = 800.0 ;
    double b = 0.75 ;
    double c = 0.6 ;
    double d = a*b*c ;
    printf("Prend %f * %f * %f = %f ( %i ) = %f ( %i ) %\n",
    a, b, c, a*b*c, (int)(a*b*c), d, (int)d) ;
    return 0;
    }
    steve@myhost ~ $ gcc test.c -o test
    steve@myhost ~ $ ./test
    Prend 800.000000 * 0.750000 * 0.600000 = 360.000000 ( 359 ) = 360.000000 ( 360 ) %
    steve@myhost ~ $ llvm-gcc test.c -o test
    steve@myhost ~ $ ./test
    Prend 800.000000 * 0.750000 * 0.600000 = 360.000000 ( 360 ) = 360.000000 ( 360 ) %
    steve@myhost ~ $ icc test.c -o test
    steve@myhost ~ $ ./test
    Prend 800.000000 * 0.750000 * 0.600000 = 360.000000 ( 360 ) = 360.000000 ( 360 ) %
    steve@myhost ~ $ gcc --version
    gcc (GCC) 4.2.1
    Copyright © 2007 Free Software Foundation, Inc.
    Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS
    GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

    steve@myhost ~ $ llvm-gcc --version # LLVM 2.0
    llvm-gcc (GCC) 4.0.1 (Apple Computer, Inc. build 5449)
    Copyright © 2005 Free Software Foundation, Inc.
    Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS
    GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

    steve@myhost ~ $ icc --version
    icc (ICC) 10.0 20070426
    Copyright (C) 1985-2007 Intel Corporation. All rights reserved.