- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Well, taking a time value in several distinct calls is certainly a WTF. Imagine what happens when the clock crosses a minute/hour/day/month/year boundary just in between those calls. If you take a lesser portion before a higher portion, you can cause a mysterious "time warp" to the future, like January 31, 23:59 (thats 11:59 p.m. for our US readers) instead of January 1, 00:00 or December 31, 23:59. If you determine a higher portion before a lesser portion, you can likewise have the time warp back into the past.
The funniest possible effect, though, is probably that you may even get an invalid date, like February 31 when the clock just switches from January 31 to February 1.
Admin
Admin
Yeah, you are "a bit disturbing", but that's why we come here.
BTW, you mean I have to type "INT_ZERO" to get a gawldang 0?! And who says my local version of zero has to be the same as your local version of zero. You mind your business I'll mind mine.
Admin
Hey, with engineers, you can never be sure. PI could be 3.14 one day, 3.14159 another day, and 3 the next. [:)]
Admin
This is why we need a binary float literal syntax...
Admin
The absolute best way to obtain pi that I've ever seen is this one:
static const double pi = atan2(0.0, -1.0);
You're guaranteed the most accurrate value no matter if your architecture is 16, 32, or 64 bit.
Admin
What makes this worse than verbosity codified, is that fact that its plain wrong :
Admin
/* minitru.h /
const int TWO_PLUS_TWO = 5; / Ignorance is Strength */