> What are the rules in C when you compare a double
> variable with a single constant?
>
> void foo(double d)
> {
>     /* Does d get converted to single, or does 0.0f get converted to
>      * double?
>      */
>     if (d == 0.0f)
>         printf("zero\n");
> }

The 0.0f is converted to a double. One site [1] has a likely looking
reference. :) Sadly, I don't know how to check the C spec directly (I
think that it is not free).

[1] https://www.eskimo.com/~scs/cclass/int/sx4cb.html
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to