# Numerical System Transformations - Lecture

• 03-08-2006
vurdlak
Numerical System Transformations - Lecture
Hy,

I wrote new article on Numerical Systems and Transformations yesterday evening (on my C Lessons Project webpage) and would like to share it with you. If someone can help me format my text for this forum, I would appreciate it, so I culd post full article here..

Here's intro:

"Our society uses numerical system based on number 10. There is a n0torious explanation why this system is used - it's simple, people have ten fingers, thus makes them easier to calculate numbers. If things were gone different, and something had messed up primordial soup -> developing Homo sapiens with eight fingers, it would be more likely we would use octal numeric system at present time. Infinite number of numerical systems exist, but following are most commonly used, and their conversion from one to another, is simple."

COntinued:
http://visualcplus.blogspot.com/2006...ations_08.html
• 03-08-2006
```#include <string> #include <ostream> #include <iostream> using namespace std; static char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXZ"; int main() {         int input = 150; // choose a number, any number         int base = 8; // choose a base <= 32         string output;         while (input != 0)         {                 output.insert(output.begin(), table[input % base]);                 input/=base;         }         cout << output << endl; }```