Ran across this in code I'm working through:
double part2 = static_cast<double>(2) * somthing1
* ( static_cast<double>(1) + something2 )
+ ( static_cast<double>(1) / static_cast<double>(2) ) * something3
+ ( static_cast<double>(1) / static_cast<double>(2) ) * pow ( something4, 3 );
(The something
s are double
s.)
I suspect that there's a really good reason for going through the trouble of doing
static_cast<double>(1)
and the like, but it seems like I could get by with a lot less typing.
What am I not understanding?
Thanks in advance.