D - Octal integers
- Paul Anagnostopoulos (8/8) Aug 18 2001 Folks,
- Walter (2/8) Aug 18 2001 I guess I'm just so used to the octal notation!
- news.digitalmars.com (16/24) Aug 18 2001 Leading
- LuigiG (8/11) Aug 19 2001 I think ADA has something like that, can't remember the syntax tho'
Folks, Please, please, don't indicate octal integers using a zero prefix. Leading zeros on numbers have no mathematical effect, and so should have no effect in a programming language. I've been burned at least three times by this "feature." Why don't you skip the 0123 for octal, 0x123 for hex, etc., and use some generic radix indicator? For example: 2'010101, 8'1234, 16'123ABC. ~~ Paul
Aug 18 2001
Paul Anagnostopoulos wrote in message <9ln2th$18ti$1 digitaldaemon.com>...Please, please, don't indicate octal integers using a zero prefix. Leading zeros on numbers have no mathematical effect, and so should have no effect in a programming language. I've been burned at least three times by this "feature." Why don't you skip the 0123 for octal, 0x123 for hex, etc., and use some generic radix indicator? For example: 2'010101, 8'1234, 16'123ABC.I guess I'm just so used to the octal notation!
Aug 18 2001
"Walter" <walter digitalmars.com> wrote in message news:9ln5hv$1a9h$1 digitaldaemon.com...Paul Anagnostopoulos wrote in message <9ln2th$18ti$1 digitaldaemon.com>...LeadingPlease, please, don't indicate octal integers using a zero prefix.effectzeros on numbers have no mathematical effect, and so should have noI have a suggestion I've always thought about. I'm incredibly used to the times I had to use it. I'm using it more and more these days for various projects, and I agree with Paul with not having octals denoted with a 0 prefix. I DO, however, think the hex way works well.. the leading 0 assures you it's an integer you're coding and the x points out, clear as day, that you're coding a hex number. octal, but admittedly that looks incredibly lame. Some other letter perhaps? Just a thought. -Bradyin a programming language. I've been burned at least three times by this "feature." Why don't you skip the 0123 for octal, 0x123 for hex, etc., and use some generic radix indicator? For example: 2'010101, 8'1234, 16'123ABC.I guess I'm just so used to the octal notation!
Aug 18 2001
"Paul Anagnostopoulos" <paul windfall.com> wrote in message news:9ln2th$18ti$1 digitaldaemon.com...Folks, Why don't you skip the 0123 for octal, 0x123 for hex, etc., and use some generic radix indicator? For example: 2'010101, 8'1234, 16'123ABC.I think ADA has something like that, can't remember the syntax tho' But really, I think it's tooo much typing! I knew 68K assembler before learning C and I remember it seemed to me unacceptable to use TWO characters "0x" just to type a hex number! ;-) (I used to think that hex should be the default base) --Luigi
Aug 19 2001