Am 16.05.2012 22:02, schrieb [email protected]: >> What is the purpose of casting stuff to float type explicitly (see >> quoted part below)? >> >> difftime() returns double, so the comparison arguments will be >> type-promoted to "double" anyways, no matter if you provide float, or >> integer. (This applies equally to the original code, not just the new >> code.) > > You might be right about the existing code doing a conversion > needlessly. My code was just following the previous example. It's a > one-character fix; just remove the "f" from "1000.0f" and it's a > double. (Of course, removing the ".0" as well would demote that > expression to an int, causing loss of data, and we don't want that.) > > I bet the compiler fixes it up anyway.
Indeed - if the compiler is standards compliant, it will type promote the right-hand side of the entire assignment to double anyways. _______________________________________________ Dnsmasq-discuss mailing list [email protected] http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
