From edd @ending from debi@n@org  Sat Aug 25 19:01:28 2018
From: edd @ending from debi@n@org (Dirk Eddelbuettel)
Date: Sat, 25 Aug 2018 12:01:28 -0500
Subject: [Rd] Where does L come from?
In-Reply-To: <CAN_1p9z=CKznjkZ-_Gwu5pGV6LX1oUKaKKnQBw-hqt6h0C1O6Q@mail.gmail.com>
References: <CABdHhvGa67SEpGkCffGpTu6P+u+0sKj-XOMP0ZNTGp0S6RmQqA@mail.gmail.com>
 <96A60DDD-DD37-48FF-BF43-94B1821A3E7F@me.com>
 <CAFDcVCQ91xLdHDRoFE1iLCxEc=cOMRg4YMfHhF++pjadbvUT-A@mail.gmail.com>
 <CAN_1p9z=CKznjkZ-_Gwu5pGV6LX1oUKaKKnQBw-hqt6h0C1O6Q@mail.gmail.com>
Message-ID: <23425.35688.465437.842641@rob.eddelbuettel.com>


On 25 August 2018 at 09:28, Carl Boettiger wrote:
| I always thought it meant "Long" (I'm assuming R's integers are long
| integers in C sense (iirrc one can declare 'long x', and it being common to
| refer to integers as "longs"  in the same way we use "doubles" to mean
| double precision floating point).  But pure speculation on my part, so I'm
| curious!

It does per my copy (dated 1990 !!) of the 2nd ed of Kernighan & Ritchie.  It
explicitly mentions (sec 2.2) that 'int' may be 16 or 32 bits, and 'long' is
32 bit; and (in sec 2.3) introduces the I, U, and L labels for constants.  So
"back then when" 32 bit was indeed long.  And as R uses 32 bit integers ...

(It is all murky because the size is an implementation detail and later
"essentially everybody" moved to 32 bit integers and 64 bit longs as the 64
bit architectures became prevalent.  Which is why when it matters one should
really use more explicit types like int32_t or int64_t.)

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] Where does L come from?
Dirk Eddelbuettel