CIS 541 – Numerical Methods
Machine Representation of Numbers
August 12, 2005 OSU/CIS 541 2
Blazing Fast
- Computers are extremely fast at performing
simple arithmetic.
– Count from one to 1,000,000,000,000 by one
- or -
– Execute on a Pentium-4 2GHz machine:
int i = 1; While (1) { printf( “%d/n”, i++ ); }
– Which reaches one trillion faster?
August 12, 2005 OSU/CIS 541 3
Blazing Fast
- Assume a human can count on average one
number per second (bad assumption).
- Implies 1 trillion seconds
- Or about 32,000 years!!!!
August 12, 2005 OSU/CIS 541 4
Blazing Fast
- Assume a human can count on average one
number per second (bad assumption).
- Implies 1 trillion seconds
- Or about 32,000 years!!!!
- Assume that a 2GHz machine can
increment by one each clock cycle.
- Implies 500 seconds!!!!