ta-sa.org - Baseclc.c

(best viewed in any resolution with any HTML enabled browser)


Main:
Index
Contact
Links

Studies:
Informatics
Scripts
Material

Projects:
Git repository

Programs:
cdplay
ECMS
lip.C
baseclc.c
nfa-util.C
tm.C
termreplace
psi_pw_decode
bummskraut

Perl:
AnyEvent::XMPP
Net::XMPP2
AnyEvent::IRC
Object::Event
AnyEvent::HTTPD
AnyEvent::EditText
MIDI::Sequencer

Music:
Ta-Sa Music
Languages:
LR Grammar Collection

Deliantra:
Deliantra

GNU Smalltalk:
Links

Other:
Laughing man logo
ta-sa.org

Java must DIE


Baseclc.c - last change: fixed some bugs on the baseclc.c page, Fri Apr 4 13:49:19 2008 +0200

baseclc.c - a base converter for numbers

This is just a small C snippet, that convertes a number given via commandline to other bases. If you make a link to the binary named 'tobase' it just converts the number to _one_ selected output base and put that binary into your path.
Build it with:

# gcc baseclc.c -o baseclc

# ln -s baseclc tobase; export PATH=$PATH:.

Run:

# ./baseclc DEADBEEF 16
 2: 11011110101011011011111011101111
 3: 100122100210211112102
 4:     3132223123323233
 5:       30122344203214
 6:        1414413525315
 7:         161402603666
 8:          33653337357
 9:          10570724472
10:           3735928559
11:           164791A470
12:            8831A383B
13:            476CC321C
14:            276253DDD
15:            16CEB1BDE
16:             DEADBEEF
17:             91D36G78
18:             61F275CB
19:             437F27AH
20:             2I79B17J

# tobase 10 10 16
A


Download: baseclc.c
All logos and trademarks on this site are property of their respective owner. Site admin is: elmex@ta-sa.org