RE: Strftime's %C and %y formats versus wide-ranging tm_year valu es
Sept. 28, 2004
1:27 p.m.
Another way to avoid problems with really big tm_year values would be to have something such as... #if (sizeof long) > (sizeof int) typedef long raw_year_type; #else typedef long long raw_year_type; #endif ...in the tzfile.h header file and then use the defined type for variables that hold results such as tmp->tm_year + TM_YEAR_BASE. It certainly makes for shorter code; as for the relative efficiency of long long arithmetic versus doubling the number of % operations being done, deponent sayeth not. --ado
7891
Age (days ago)
7891
Last active (days ago)
0 comments
1 participants
participants (1)
-
Olson, Arthur David (NIH/NCI)