binary to decimal??
Blitz3D Forums/Blitz3D Programming/binary to decimal??
| ||
hello, is there a command that I spent a binary number to decimal. |
| ||
text 0,0, %11111111 will print 255 |
| ||
I don't believe there is - you have to make your own. A binary number is a representation of a fixed number of digits. It's up to you to decide where to put the decimal point. Typically, you convert the binary to an integer, then divide it by 10 times the number of places you want to move the decimal point by. Fixed point decimals always have their decimal point in the dead center of the number (0000.0000) regardless of the number. I'm not sure about floating point decimals, but I think they move the decimal point to the center of the bulk of the non-zero numbers? I hope I got that right.. :D |
| ||
ClayPigeon I don't think you have any idea what you're talking about...Yue see JBR's answer above. |
| ||
http://www.blitzbasic.com/Community/posts.php?topic=92570#1055523 |
| ||
Ohhhhhh- you mean binary to DECIMAL number. I thought he was saying binary to a number that contains a decimal point in some shape or form. Sorry. :) |
| ||
@ JBR: hear and what happens when I use $ this operator is the role. Sample $1978 |
| ||
Hi, %11111111 is binary ( 0,1) $FF is hexa decimal ( 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F ) both = 255 decimal I'd do a google search to find out more. (wiki maybe have good description) Jim |
| ||
^wot he said ps $1978 = 6520 in hex 2 decimal. Last edited 2010 |