Well I suppose the question is:
How do you suppose we represent a negative number in an unsigned int? In reflection both codes return a value which indicates if the value is positive or negative, which I failed to notice in your code sample. I stand corrected. |
Hi, waqasdaar -
Now that you've got these cool routines (and they *are* cool!) ... please be sure to take the results with a pound of salt (or better, to quote Andrew Tanenbaum, with a "metric ton of salt"). Results are seldom accurate to-the-millisecond, much less to the microsecond. At the very least, you'll definitely want to run multiple tests, and average your results... |
Quote:
|
I don't understand why the other functions posted are so complicated. It can be done in a single long line.
Code:
#include <stdio.h> |
Quote:
The code kinda changed incrementally. Or, as one of my past cow-orkers was known to say, "excrementally". |
All times are GMT -5. The time now is 09:13 PM. |