I tried your code with MinGW and VS compilers and I got 170 and 170000. What compiler are you using? and what system? did you try casting with static_cast?
Specifically, your compiler appears to be a rounding the results of the multiplying 1.6999999999999999555910790149937383830547332763671875 by 1000.0 and 1.6999999999999999555910790149937383830547332763671875 by 1000000.0 down/to zero instead of the more common rounding to the nearest valid double.
As for the second output being 170000, try std::setprecision(100) and you'll see that Eff_d_ is actually 169999.89999999999417923390865325927734375. That's just the default output format.
@Cubbi
Well isnt rounding happen when the number is to big to fit recever format ?
and
1.6999999999999999555910790149937383830547332763671875 how did u get it?
Eff is 1.7, 1.7 * 1000.0 should come 1700
btw im kinda new in programing. maeby i changed some settings that i shouldnt. :)
but were it did gues that i need rounding.(that troubles me)
1.7 * 1000.0 = 1700.0 and not 1699.....
Eff is not 1.7 because 1.7 is not a valid value for a double.
Rounding happens, yes, and the value that's actually stored is 7656119366529843 x 2-52 or 1.6999999999999999555910790149937383830547332763671875. The default precision of std::cout is 6, so it is presented as "1.7" for output only.
im still looking on Code::Blocks forum is there is another post related to this one,
and if i dont find one il post one.
Because this happends only on Debug and not on Relese.
kinda mind bugling that it stores something else, instead of what i expected to be there. :|
im gona use it like this atm as it doese the job.
later il find out a nicer way