User talk:Armithaig: Difference between revisions

913 bytes added ,  20:07, 15 February 2023
explain base prefixes
(Created page with "Hey, why did you do the roll back of https://wiki.cavesofqud.com/index.php?title=Modding:Events&curid=8683&diff=86909&oldid=86908 ? The value is 16, not 10. 10 is CASCADE_INVENTORY + CASCADE_COMPONENTS")
 
(explain base prefixes)
Line 2: Line 2:


The value is 16, not 10. 10 is CASCADE_INVENTORY + CASCADE_COMPONENTS
The value is 16, not 10. 10 is CASCADE_INVENTORY + CASCADE_COMPONENTS
:Ello, was hoping the rollback action'd let me provide a comment but that wasn't the case.
:The <source lang="c#" enclose="none>0x</source> prefix in C# indicates the defined integer literal is hexadecimal (the <source lang="c#" enclose="none>0b</source> in the comments indicates binary).
:You are correct that the decimal value is 16, but in base 16 this is written <source lang="c#" enclose="none>10</source> or <source lang="c#" enclose="none>0x10</source> with the C# prefix, each character (from 0 to F/15) here representing the value of a nibble (four bits) in a byte or beyond.
: Afraid that <source lang="c#" enclose="none>0x16</source> would be 22 in base 10. Your OS should have a calculator that can convert numerical bases, if you wish to confirm c: (the windows one requires entering the "programmer view").
:[[User:Armithaig|Armithaig]] ([[User talk:Armithaig|talk]]) 20:07, 15 February 2023 (UTC)