Article View: comp.std.c++
Article #3449Numeric literal formats
From: Paul D. DeRocco
Date: Sat, 17 Feb 1996 12:28
Date: Sat, 17 Feb 1996 12:28
22 lines
1471 bytes
1471 bytes
Why, oh why, aren't we allowed to write binary numbers in C++? The standard could trivially be extended by allowing binary numbers to be written, prefixed with 0b, or perhaps 0y. This makes bit masks _much_ easier to read. And it wouldn't break any presently legal program. Another related improvement would be to allow embedded underscores in numbers, for clarity. 1_000_000_000 is obviously a billion, while 1000000000 is not so obviously a billion. Same for 0x8000_0000, or 0y0001_1110_0000_0000. Again, it doesn't break anything. Oh heck, I might as well throw this in. Why isn't there an escape for escape? That is, why can't \e be defined as \x1B, since it's such a common control character? -- Ciao, Paul D. DeRocco --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. Moderation policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Technical Details
Message-ID:
<3125C1DC.35AE@ix.netcom.com>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backShow Full Headers
Complete Article Headers
From: "Paul D. DeRocco" <pderocco@ix.netcom.com> Message-ID: <3125C1DC.35AE@ix.netcom.com> X-Original-Date: Sat, 17 Feb 1996 06:54:04 -0500 Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 17 Feb 96 12:28:43 GMT Approved: fjh@cs.mu.oz.au Organization: - Newsgroups: comp.std.c++ X-Mailer: Mozilla 2.0b6a (Win95; I) Subject: Numeric literal formats X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMSXKC+EDnX0m9pzZAQFqKAF8C7Hczr/GQokrVzKk7/8V/1Kw3Z5ARI9v 4nM8CRUnz84mD7b9KAJbKl9p4q077GoD =g247