Jump to page: 1 25  
Page
Thread overview
Octals
May 25, 2004
DemmeGod
May 25, 2004
Walter
May 25, 2004
Stephan Wienczny
May 25, 2004
DemmeGod
May 25, 2004
Roberto Mariottini
May 25, 2004
Andy Friesen
May 25, 2004
Juan C
May 25, 2004
Stephan Wienczny
May 25, 2004
Hauke Duden
May 25, 2004
Walter
May 25, 2004
davepermen
May 25, 2004
Stephan Wienczny
May 26, 2004
Matthew
May 26, 2004
Juan C
May 26, 2004
Andrew Edwards
May 26, 2004
Matthew
May 26, 2004
David L. Davis
May 26, 2004
Arcane Jill
May 26, 2004
Hauke Duden
May 26, 2004
Matthew
May 26, 2004
at0mic
May 26, 2004
Juan C
May 26, 2004
Walter
May 26, 2004
Kevin Bealer
May 26, 2004
Walter
May 27, 2004
Arcane Jill
May 28, 2004
Walter
May 26, 2004
Stewart Gordon
May 26, 2004
Matthew
May 27, 2004
Kevin Bealer
May 27, 2004
Andy Friesen
May 27, 2004
Matthew
May 26, 2004
Sean Kelly
May 26, 2004
Walter
May 26, 2004
Juan C
May 26, 2004
davepermen
May 26, 2004
Matthew
May 26, 2004
davepermen
May 27, 2004
Juan C
May 27, 2004
David L. Davis
May 27, 2004
Matthew
May 27, 2004
Roberto Mariottini
May 26, 2004
Matthew
May 26, 2004
davepermen
May 26, 2004
Matthew
May 26, 2004
davepermen
May 25, 2004
Mike Swieton
May 25, 2004
Stewart Gordon
May 25, 2004
From the specs:
" Octal integers are a sequence of octal digits preceded by a '0'."

I wanted to verify that octal is represented by digits preceded by a zero, as the spec says.  Is this true?
May 25, 2004
"DemmeGod" <me@demmegod.com> wrote in message news:pan.2004.05.25.01.03.32.701233@demmegod.com...
> From the specs:
> " Octal integers are a sequence of octal digits preceded by a '0'."
>
> I wanted to verify that octal is represented by digits preceded by a zero, as the spec says.  Is this true?

Yes.


May 25, 2004
An octal looks like this

01
07
0123

or this

\1 \7 \123

By the way you don't believe Walter?

DemmeGod wrote:
> From the specs:
> " Octal integers are a sequence of octal digits preceded by a '0'."
> 
> I wanted to verify that octal is represented by digits preceded by a zero,
> as the spec says.  Is this true?
May 25, 2004
From Specs:
"	Octal:
		0 OctalDigits"

That zero looked like an uppercase 'o' in my browser.  Just wanted to make sure.

On Tue, 25 May 2004 03:11:50 +0200, Stephan Wienczny wrote:

> An octal looks like this
> 
> 01
> 07
> 0123
> 
> or this
> 
> \1 \7 \123
> 
> By the way you don't believe Walter?
> 
> DemmeGod wrote:
>> From the specs:
>> " Octal integers are a sequence of octal digits preceded by a '0'."
>> 
>> I wanted to verify that octal is represented by digits preceded by a zero, as the spec says.  Is this true?

May 25, 2004
On Mon, 24 May 2004 21:03:33 -0400, DemmeGod wrote:

> From the specs:
> " Octal integers are a sequence of octal digits preceded by a '0'."
> 
> I wanted to verify that octal is represented by digits preceded by a zero, as the spec says.  Is this true?

Why not try it?

int main(char[][] args) { int x = 0777; return 0; }

It'll take a lot less time than posting.

Mike Swieton
__
You can have peace. Or you can have freedom. Don't ever count on having
both at once.
	- Lazarus Long (Robert A. Heinlein)

May 25, 2004
>An octal looks like this
>
>01
>07
>0123
>
>or this
>
>\1 \7 \123
>

BTW, what about deprecating octals starting with 0?

I keep winning bets with C and C++ programmers about 010 == 8 (some old C
compilers accepted 010 == 08), but it's a bit annoying.
Many beginners start aligning numbers with leading 0s just to discover that it
doesn't work for historical reasons unknown to the most.

Moreover I don't see any practical use for octal numbers nowadays, and I don't think it's worth supporting them for very old legacy C code (that has to be rewritten anyway IMHO).

Ciao


May 25, 2004
Mike Swieton wrote:
<snip>
> Why not try it?
> 
> int main(char[][] args) { int x = 0777; return 0; }
> 
> It'll take a lot less time than posting.

Depends on whether D compiler and Internet connection are in the same place, as mine aren't for instance.

But it's also quite simple to c&p stuff from a typical browser into something that lets you see it in a font that clearly distinguishes O and 0.  (Of course, messing with browser settings also tends to work, though not always.)

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment.  Please keep replies on the 'group where everyone may benefit.
May 25, 2004
Roberto Mariottini wrote:

>>An octal looks like this
>>
>>01
>>07
>>0123
>>
>>or this
>>
>>\1 \7 \123
>>
> 
> 
> BTW, what about deprecating octals starting with 0?
> 
> I keep winning bets with C and C++ programmers about 010 == 8 (some old C
> compilers accepted 010 == 08), but it's a bit annoying.
> Many beginners start aligning numbers with leading 0s just to discover that it
> doesn't work for historical reasons unknown to the most.
> 
> Moreover I don't see any practical use for octal numbers nowadays, and I don't
> think it's worth supporting them for very old legacy C code (that has to be
> rewritten anyway IMHO).

Octal numbers still have their uses here and there. (like Unix file permission attributes)

I wouldn't be against changing the syntax, though.  How about 0o10 == 10?  It's somewhat symmetrical with the 0x hex notation, and is clearly not a decimal integer.

 -- andy
May 25, 2004
>I wouldn't be against changing the syntax, though.  How about 0o10 == 10?  It's somewhat symmetrical with the 0x hex notation, and is clearly not a decimal integer.

I like that, but don't you nean  0o10 == 8 (decimal)? And then mightn't it be possible to remove that leading zero from these and hexes as redundant?


May 25, 2004
The leading 0 makes it easier to lex.
If you find a 0 you know it will be a number. If you only had o what would you do in this case:

o123

This is an valid identifier and if we drop the 0 a valid number ;-(

Stephan

Juan C wrote:

>>I wouldn't be against changing the syntax, though.  How about 0o10 == 10?  It's somewhat symmetrical with the 0x hex notation, and is clearly not a decimal integer.
> 
> 
> I like that, but don't you nean  0o10 == 8 (decimal)? And then mightn't it be
> possible to remove that leading zero from these and hexes as redundant?
> 
> 
« First   ‹ Prev
1 2 3 4 5