I think wqw is right, but I'll give the details.
In the statement clng(150 * 0.85)
, 150 * 0.85
is calculated in extended-precision:
150 = 1.001011 x 2^7
0.85
in double precision =
1.1011001100110011001100110011001100110011001100110011 x 2^-1
Multiply these by hand and you get
1.1111110111111111111111111111111111111111111111111111110001 x 2^6 =
127.4999999999999966693309261245303787291049957275390625
That's 59 bits, which fits comfortably in extended-precision. It's less than 127.5
so rounds down.
In the statement x = 150 * 0.85
, that 59 bit value is rounded to 53 bits, giving
1.1111111 x 2^6 = 1111111.1 = 127.5
So it rounds up according to round-half-to-even.
(See my article http://www.exploringbinary.com/when-doubles-dont-behave-like-doubles/ for more information.)