2 ms·
A whole byte for a year? What a waste in 1995 when you've got just 640KB for DOS, your code and your data. I looked up my old code. Shave off a bit of the year
by unilynx 7y ago
A whole byte for a year? What a waste in 1995 when you've got just 640KB for DOS, your code and your data.
I looked up my old code. Shave off a bit of the year and:
struct Date {
unsigned day : 5;
unsigned month : 4;
unsigned year : 7;
};
a full date in 16 bits. (well, in borland C++ 5 at least)
and as it was an accounting application, working with the bitfields was so much nicer than ordinal days you would use nowadays.
month and years was all you really cared about anyway when summarising data. in finance all months have 30 days anyway.
- C1sc0cat 7y agothe problem came from the 60's when memory was really expensive on mainframes and you had things like drum storage