ID:136247
 
I've been testing the limits of built in numeric vars and there is one that confuses me. dir is limited as a value from 1 to 255. Why can't an atom have a dir of 0? It would still fit in a short integer, and 0 is no less valid than 255.
Because 0=null, not 0 as in a number. But im guessing i have no idea what your doing, so i could be wrong.
In response to Scoobert
In DM, 0 does not equal null. You can not set the atom.dir var to 0, but it will accept any value from 1 to 255. An unsigned short integer (8 bits) can store a whole number from 0 to 255, so why is the 0 gone from dir? They aren't saving any space by leaving it out.
In response to Shadowdarke
Shadowdarke wrote:
In DM, 0 does not equal null. You can not set the atom.dir var to 0, but it will accept any value from 1 to 255. An unsigned short integer (8 bits) can store a whole number from 0 to 255, so why is the 0 gone from dir? They aren't saving any space by leaving it out.

An unsigned short can store any number from 0 to 65,535. You're thinking of a 'char'. =)
In response to Spuzzum
Oh yeah! Still doesn't explain the missing 0 >.<
In response to Shadowdarke
Maybe the would-be-zero is used as null?