Should rand() return a RAND_MAX value for 32 bit target?

Vincent Lefevre vincent+gcc@vinc17.org
Sat Sep 22 10:08:00 GMT 2018


On 2018-09-22 10:17:04 +0200, Vincent Lefevre wrote:
> Thus if one does
> 
>   float a;
>   int b;
> 
>   /* ... */
>   a + b;
> 
> with FLT_EVAL_METHOD = 2, the evaluation type of a is long double, b
> is converted to the semantic type float, but its evaluation type is
> long double, so that its value should not change if representable as
> a long double. That's what FLT_EVAL_METHOD means. The *only* cases
> for which the precision and range need to be reduced to those of the
> semantic type if for assignment and cast, but here one just has an
> implicit conversion.

Bug reported here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87390
(note that the tests do not involve constants, these are just about
implicit type conversions).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



More information about the Gcc-help mailing list