http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55726

--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-22 08:57:14 
UTC ---
(In reply to comment #4)
> template<typename Float>
> inline
> Float atan(Float t) {
>   constexpr float PIO4F = 0.7853981633974483096f;
>   constexpr Float zero = {0};
>   Float ret = ( t > 0.4142135623730950f ) ? zero+PIO4F : zero;
> …
> }

Minor remark: I think you can just write PIO4F instead of zero+PIO4F. Since the
other alternative in ?: is a vector, it should convert the scalar
automatically.

I am actually planning for later that you can even replace zero with 0: when
the condition in ?: is a vector, the result has to be a vector, even if the 2
alternatives are scalars, so it could guess the return type based on the types
of the scalars and the size / number of elements of the condition. But that's
for a distant future.

Reply via email to