Regarding the proposed Binray Literals Deprecation
Walter Bright
newshound2 at digitalmars.com
Sat Sep 10 02:31:05 UTC 2022
On 9/9/2022 4:53 PM, Adam D Ruppe wrote:
> The nice thing is D lets you group the bits withunderscores.
Yes, that is a great feature I copied from Ada, where it had lain forgotten. Now
everyone is adding it!
> So you might do like 0b11_111_101_001 which makes it a lot easier to manage and
> you can group something like a flags register the same way it appears in the
> documentation.
I haven't seen CPUs that were documented in octal since the PDP-11, even though
it didn't quite work with 16 bits. It was a holdover from the 36 bit PDP-10. 8
and 16 bit processors ever since used hex.
BTW, a 0 should go after the b, unless you've got an 11 bit flags register!
It's still easier to write as 0x7E9.
More information about the Digitalmars-d
mailing list