[LLVMdev] Wrong tan

Gonsolo gonsolo at gmail.com
Fri Jun 15 23:50:10 PDT 2007


Hi!

<tangens_bug.cc>

#include <iostream>
#include <cmath>

int main()
{
        float a = 0.3;
        double b = 0.3;

        float result_a = std::tan( a );
        float result_b = std::tan( b );
        std::cout << "tan float: " << result_a << std::endl;
        std::cout << "tan double: " << result_b << std::endl;
}


<end tangens_bug.cc>

Result compiled with g++ 4.1:
tan float: 0.309336
tan double: 0.309336

Result compiled with llvm-g++ 2.0:
tan float: -2.18504
tan double: 0.309336

Am I missing something or should I file a bug report?

Thanks,
Gonsolo



More information about the llvm-dev mailing list