conv()WE can convert any number from one mathematical base number system to another base number system by using conv() function in MySQL. Here is the syntax
Here n is any number and base_from is base of n ( the number ) at present. base_to is the base of the number we want to covert. Minimum base value is 2 and maximum base value is 36. Let us try one example
Here number is b of base 16 , after conversion it will have base of 2 . The output is here
Now let us try one octal number
Octal number to decimal ( base 10 )
In above code number 11 is of base 8 and after conversion it became decimal number of base 10. Here is our output
In conventional way it is 11=1x8^{1} + 1x8^{0} , so 11 in octal is equal to 9 in decimal. You can also use MySQL oct function to covert decimal number to Octal system
Hex to binaryHex numbers have base of 16 and binary is of base 2
Output is
Decimal to HexDecimal is of base 10 and Hex is of base 16
The output is here
Convert numbers from decimal to Octal base systemWe can convert decimal number to octal number by using oct function. Here are examples
This article is written by plus2net.com team.
