typecasting question

Started by
0 comments, last by Theses 23 years, 10 months ago
i''m just wondering for any function say for example here glColor3f which has 3 parameters all floats now for the question is there any difference between glColor3f(1.0, 1.0, 1.0); and glColor3f(1.0f, 1.0f, 1.0f); or in other words does this promotion to double have any effect on the first one
Advertisement
quote:Original post by Theses

i''m just wondering for any function say for example here
glColor3f
which has 3 parameters all floats
now for the question
is there any difference between
glColor3f(1.0, 1.0, 1.0);
and
glColor3f(1.0f, 1.0f, 1.0f);
or in other words does this promotion to double have any effect on the first one


Depends on the compiler, if it sticks to its guns, the first one will store the 1.0''s as doubles in ram, and convert them to floating points before each function call (SLOW!)- the second one will just call the funcion with the fp values.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement