What kind of numbers are that?
i.e. $00000100
Why not normal numbers?
What are numbers with that $ ?
Re: What are numbers with that $ ?
These are hexadecimal numbers, meaning numbers to base 16 instead of 10. 

Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Re: What are numbers with that $ ?
http://en.wikipedia.org/wiki/Hexadecimal
Hexadecimal notation bears a more obvious relationship to the underlying binary used by the microprocessor than does decimal notation - each hex digit translates to a group of 4 binary digits. Once you get used to working with it, it offers some efficiencies for programmers.
Hexadecimal notation bears a more obvious relationship to the underlying binary used by the microprocessor than does decimal notation - each hex digit translates to a group of 4 binary digits. Once you get used to working with it, it offers some efficiencies for programmers.
Re: What are numbers with that $ ?
I asking myself why not using 256 instead $00000100.Because its the same.
And $1800 is $00001800 or $18000000?
And $1800 is $00001800 or $18000000?
Re: What are numbers with that $ ?
At the risk of repeating myself - hexadecimal notation bears a more obvious relationship to the underlying binary used by the microprocessor than does decimal notation.
You can transcribe your example $1800 - always starting from the right hand (least significant digit) end - as:
0000 0000 0000 0000 0001 1000 0000 0000 in binary - its much harder to make the same transcription from a decimal number.
You can transcribe your example $1800 - always starting from the right hand (least significant digit) end - as:
0000 0000 0000 0000 0001 1000 0000 0000 in binary - its much harder to make the same transcription from a decimal number.
Re: What are numbers with that $ ?
Aye, when dealing with bitwise operators, raw binary or decimals are simply too verbose. Hexadecimal is a great compromise.
Take RGB colors for example. The color value 15790320 means nothing to me. Convert to hexadecimal, however (which equates to $F0F0F0) then we quickly see that the intensities of red, green and blue are all equal, meaning we have a shade of grey here. This is but one example of how useful hexadecimal can be.
Take RGB colors for example. The color value 15790320 means nothing to me. Convert to hexadecimal, however (which equates to $F0F0F0) then we quickly see that the intensities of red, green and blue are all equal, meaning we have a shade of grey here. This is but one example of how useful hexadecimal can be.
I may look like a mule, but I'm not a complete ass.
Re: What are numbers with that $ ?
I thought $100 meant something was costing one hundred dollars 

"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: What are numbers with that $ ?
No, in fact it will cost you 256 dollarsluis wrote:I thought $100 meant something was costing one hundred dollars

{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: What are numbers with that $ ?
Hi nathan78. You're absolutely right; you can safely use either one in PureBasic.nathan78 wrote:I asking myself why not using 256 instead $00000100.Because its the same.
As with decimal numbers, the leading zeroes are insignificant. You can easily check hexadecimal values with PureBasic's Val() function, like this:nathan78 wrote:And $1800 is $00001800 or $18000000? (leading zeroes are ignored)
Code: Select all
Debug Val("$1800") ;6144
Debug Val("$00001800") ;6144
Debug Val("$18000000") ;402653184
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: What are numbers with that $ ?
Hi srod. Right as always, although it should be noted that such hexadecimal values are not representational of the conventional R-G-B arrangement.srod wrote:Take RGB colors for example. The color value 15790320 means nothing to me. Convert to hexadecimal, however (which equates to $F0F0F0) then we quickly see that the intensities of red, green and blue are all equal...
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 
