×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Base conversion: Difference between revisions

    Content added Content deleted
    imported>mutante
    mNo edit summary
    imported>mutante
    mNo edit summary
     
    (One intermediate revision by the same user not shown)
    Line 1: Line 1:
    #/bin/[[bash]]
    #/bin/[[bash]]


    echo "23 decimal is `echo 'obase=16; ibase=10; 23' | bc` in hex."
    echo "23 decimal is `echo 'obase=16; ibase=10; 23' | [[bc]]` in hex."
    23 decimal is 17 in hex.
    23 decimal is 17 in hex.


    Line 16: Line 16:
    10111 binary is 23 in decimal.
    10111 binary is 23 in decimal.


    echo "There are only `echo 'obase=10; ibase=10; 10' | bc` types of people in the world. Those who understand binary, and those who don't".
    echo "There are only `echo 'obase=10; ibase=2; 10' | bc` types of people ..."
    There are only 10 types of people in the world. Those who understand binary, and those who don't.
    There are only 2 types of people .. [http://www.thinkgeek.com/tshirts/frustrations/5aa9/]


    ...
    etc ...


    [[Category:Linux]]
    [[Category:Linux]]

    Latest revision as of 14:19, 7 April 2006

    #/bin/bash
    
    echo "23 decimal is `echo 'obase=16; ibase=10; 23' | bc` in hex."
    23 decimal is 17 in hex.
    
    echo "23 in hex is `echo 'obase=10; ibase=16; 23' | bc` in decimal."
    23 in hex is 35 in decimal.
    
    echo "666 in octal is `echo 'obase=10; ibase=8; 666' | bc` in decimal."
    666 in octal is 438 in decimal.
    
    echo "77 base 7 is `echo 'obase=10; ibase=7; 77' | bc` in decimal."
    77 base 7 is 48 in decimal.
    
    echo "10111 binary is `echo 'obase=10; ibase=2; 10111' | bc` in decimal."
    10111 binary is 23 in decimal.
    
    echo "There are only `echo 'obase=10; ibase=2; 10' | bc` types of people ..."
    There are only 2 types of people .. [1]
    

    etc ...

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.