The result of that formula is very large, so there is a possibility
that it will not fit into a 64-bit integer.
The first comparison uses 'double' type to check if this number is too
large. If it is, it is certainly bigger than t. If it is not, more
precise integer computations can be used (second comparison).
I guess 1.5 is just a large enough number to be safe.

I personally used 'unsigned long long' instead, and that was enough to
avoid dealing with floating point calculations.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to