summaryrefslogtreecommitdiff
path: root/libc/test/src/complex/cimag_test.cpp
AgeCommit message (Collapse)Author
2024-11-03[libc][complex] implement different flavors of `creal` and `cimag` functions ↵Shourya Goel
(#113300) I have commented out the test for `neg_zero`(creal) because : 1. real(neg_zero + 0.0i) equals zero. 2. real(neg_zero - 0.0i) equals neg_zero. I am not sure if this is the intended behaviour. [EDIT] I have updated tests for `neg_zero` (creal) to be : ``` EXPECT_FP_EQ(func(CFPT(neg_zero - zero * 1.0i)), neg_zero); EXPECT_FP_EQ(func(CFPT(neg_zero + zero * 1.0i)), zero); ``` because all three [gcc, clang and GNU MPC] also give the same result. https://godbolt.org/z/hxhcn6aof and it seems that it is indeed the correct behaviour since Imaginary types are not supported yet, refer #113671