>> If dividend and divisor are both positive and integer, C's / is >> flooring division. [Brett C.] > That's what I figured. Although isn't that assuming time_t is an int > or long or something? The grownup phrase is "integral type" <wink>. You're right that it's a dubious assumption: all C requires of time_t is that it resolves to an arithmetic type. "Arithmetic type" is the union of the integral, real, and (in C99) complex types. With FPUs much faster than they used to be, and 32-bit ints running out of room to store seconds since 1970: >>> import datetime as d >>> print d.datetime(1970, 1, 1) + d.timedelta(seconds=2**31-1) 2038-01-19 03:14:07 >>> I wouldn't be surprised to see some systems switching to doubles for time_t. Probably not this decade, although the JavaScript (ECMAScript) time type was deliberately designed to work beautifully when stored in an IEEE-754 double, and has much greater range and precision than the typical POSIX time type. > But the entire chunk of code seems to assuming that so what is one > more spot of code. =) I'll be dead by 2038 -- this is my generation's way of giving employment security to yours <wink>.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4