ID:1541597
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Out of curiosity, I decided to explore DM's support for non-decimal numbers.
It seems that all the standard operators will take hex and octal with no complaints.
In fact, they work just fine even when mixing bases, e.g.
0xF2 + 072 * (1287-0xA7) ** 03


Surprisingly, however, DM does not appear to support binary!
This is not a particularly pressing issue, since i'm sure we all feel comfortable converting decimal to up to 16 bits of binary in our heads by now (though my TI-36X can only claim 8).
On the other hand, considering the extensive support for octal and hex, i can't imagine it'd be all that difficult to embrace binary as well.

PS: It seems that many built-in procs choke on non-decimal numbers, for example text2num(). I'm not sure whether to file bug reports about these, since non-decimal functionality is completely undocumented and may (sadly) be deprecated.

PPS: I'd suggest changing
error: bad number
to
error: this makes octalpus sad :(
It is both slightly more amusing and significantly more informative.
I just don't see the point of adding binary parsing to the language. Anyone who can wrangle binary can wrangle hexadecimal. Frankly I think even octal is kind of silly; it was never a well thought-out base for programming and I'm surprised C ever supported it intrinsically.
Yeah, this isn't exactly a serious request.
If it's ever helpful to represent certain things in binary/other bases, the CPP can handle it anyway.

On the other hand, DM's octal & hex support came as a surprise.
I actually discovered it while trying to use leading zeros on something: the compiler threw "bad number" as soon as it hit "08".

Is there a proper place to make requests for documentation?
I can think of several features that would probably be better found in the Reference than through trial-and-error.

Feature requests could be such a place, or any dev help forum, where users could give input on an undocumented feature.
The hex support isn't documented? It's been a while since I looked but I would expect that to be documented somewhere.
It's not in either the Ref or Guide, not sure what else is considered official
Huh. Well that's something I'd like to remedy at some point, then.