[125396] in North American Network Operators' Group
Re: APNIC Allocated 14/8, 223/8 today
daemon@ATHENA.MIT.EDU (Dave Hart)
Wed Apr 14 08:46:02 2010
In-Reply-To: <4BC588EB.8000105@foobar.org>
From: Dave Hart <davehart@gmail.com>
Date: Wed, 14 Apr 2010 12:45:23 +0000
To: Nick Hilliard <nick@foobar.org>
Cc: NANOG <nanog@nanog.org>, Srinivas Chendi <sunny@apnic.net>
Reply-To: davehart_gmail_exchange_tee@davehart.net
Errors-To: nanog-bounces+nanog.discuss=bloom-picayune.mit.edu@nanog.org
On Wed, Apr 14, 2010 at 09:20 UTC, Nick Hilliard wrote:
> On 14/04/2010 08:06, Srinivas Chendi <sunny@apnic.net> wrote to SANOG:
>> =C2=A0 =C2=A0 014/8
>> =C2=A0 =C2=A0 223/8
>
> Sunny,
>
> Please be careful about how you write this. "014" is formally an octal
> representation, and what you've written there actually means that APNIC h=
as
> received 12/8 (=3D octal 014).
>
> Nick
Nick,
My eyebrow raised at the leading zero as well, but I'd call it
ambiguous. 0x14 is unambiguously decimal 20, but 014 is only
unambiguous in a context that defines leading zero as implying octal.
For a C program relying on the runtime to convert text to numeric
representation, it depends. sscanf("%d", &myint) will convert 014 to
decimal 14, "%i" gets decimal 12.
I personally hunt down and kill %i and other octal-assuming code when
I see it, except where octal is conventional. To my eyes, 0xFF (or
FF) screams "all bits lit" while 0377 (or 377) only hesitantly clears
its throat. Moreover, I assume computers will be used by people who
have never had reason to believe a leading zero implies base 8, and I
find no joy in forcing them to learn that quirk of computing history.
Take care,
Dave Hart