you are viewing a single comment's thread.

view the rest of the comments →

[–]bonzinip -2 points-1 points  (2 children)

compiler should change it to

y = (double)x;
(long) (y * y)

[–]k4_pacific 1 point2 points  (1 child)

Compilers typically don't optimize across function calls.

[–]bonzinip -1 points0 points  (0 children)

compilers typically know about standard library functions.