Division by complex in clang++ versus g++

前端 未结 4 1704
无人及你
无人及你 2021-02-19 16:57

When I compile the following code with g++ (4.8.1 or 4.9.0) or clang++ (3.4) I get different outputs.

#include 
#include 

int mai         


        
4条回答
  •  余生分开走
    2021-02-19 17:27

    Yes. You should report a bug.

    The complex number 1e-162+0i is identical to the real number 1e-162. This falls well within the range of double. The reciprocal of this value is and should be 1e+162. Any other value represents a bug in the arithmetic libraries.

    The value returned by clang is wrong. It's a bug.

提交回复
热议问题