Eight, Nine, Ten...

Started by
31 comments, last by Khatharr 11 years ago


What is the most common number that begins with 0?



0!


I almost questioned why you are using 0! (aka. zero-bang, aka. 0 factorial). biggrin.png


but 0!=!0...


random trivia...
not being content with just having NULL, I have a number of other values in the same area:
UNDEFINED //like NULL but not NULL (*3)
BGBDY_TRUE //when you need a boolean TRUE value as a pointer (*3)
BGBDY_FALSE //likewise, but FALSE
AUXNULL //for when you need to express a NULL but NULL and UNDEFINED are already busy (*1)
BGBGC_NULLEND //for when your NULL should really be a 'void' (and a thread has just terminated, *2)
...

*1: AUXNULL==NULL except when AUXNULL!=NULL... yes, sometimes actually useful...
*2: generally to save the cost of keeping around the state to hold a NULL that wont actually be referenced (basically, because you can't "join()" a thread which returns 'void').

*3: UNDEFINED is TRUE for "if()" whereas NULL is FALSE, but sometimes also needed is a FALSE/TRUE that are distinct from NULL/UNDEFINED.


as for naming numbers:
actually, surprisingly, there are people who seem to think this practice is a good idea.

apparently especially off in the land of a certain language unnamed here...
Advertisement

Could be binary coded decimal... [snip]

That sounds so convoluted it requires its own thread.

Unfortunately that wasn't the case here - this code, according to a colleague who originally fixed it - caused a fatal crash in the software.

BCD was pretty common once, there are even x86 assembler instructions that work with BCD numbers!

But I guess that wasn't what was intended here :)

When I was around 18 or so I used to hack around the memory of my PSX games with a gameshark (the kind that plugged into the back and allowed memory/debug access - now considered illegal). I remember coming across BCD in some game when I was searching for the address of the HP values or something similar and when I finally realized what was happening I laughed for a solid five minutes at how crazy it seemed. I wish I could remember what game it was.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

This topic is closed to new replies.

Advertisement