# Thread: Numerical System Transformations - Lecture

1. ## 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

2. I noticed you have 8 link about the subject of bases and conversion. That's really overkill, as there is only 2 types. General purpose, and the fast method for 2^x bases. This subject gets asked quite alot, and it's really easy. Why not add some code?
Code:
```#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;
}```

3. thnx cool! gonna implement it, just I have to cover some topics about parts of your code first, then I'll introduce this code.

cya!