From wdunl@p @ending from tibco@com  Mon Aug 27 05:30:17 2018
From: wdunl@p @ending from tibco@com (William Dunlap)
Date: Sun, 26 Aug 2018 20:30:17 -0700
Subject: [Rd] Where does L come from?
In-Reply-To: <74ce0f99-29b2-6cd4-8144-e0b191f49a85@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>
 <23425.35688.465437.842641@rob.eddelbuettel.com>
 <6ae89d21-0a0d-805a-e8db-9de20c42a019@fredhutch.org>
 <74ce0f99-29b2-6cd4-8144-e0b191f49a85@gmail.com>
Message-ID: <CAF8bMca4-bO_3GK-=9O8jWU2nR0uyqw5SqLA+UjDSmjH7zvK4A@mail.gmail.com>

>  the lack of a decimal place had historically not been significant

Version 4 of S (c. 1991) and versions of S+ based on it treated a sequence
of digits without a decimal  point as integer.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Sat, Aug 25, 2018 at 4:33 PM, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

> On 25/08/2018 4:49 PM, Herv? Pag?s wrote:
>
>> The choice of the L suffix in R to mean "R integer type", which
>> is mapped to the "int" type at the C level, and NOT to the "long int"
>> type, is really unfortunate as it seems to be misleading and confusing
>> a lot of people.
>>
>
> Can you provide any evidence of that (e.g. a link to a message from one of
> these people)?  I think a lot of people don't really know about the L
> suffix, but that's different from being confused or misleaded by it.
>
> And if you make a criticism like that, it would really be fair to suggest
> what R should have done instead.  I can't think of anything better, given
> that "i" was already taken, and that the lack of a decimal place had
> historically not been significant.  Using "I" *would* have been confusing
> (3i versus 3I being very different).  Deciding that 3 suddenly became an
> integer value different from 3. would have led to lots of inefficient
> conversions (since stats mainly deals with floating point values).
>
> Duncan Murdoch
>
>
>
>> The fact that nowadays "int" and "long int" have the same size on most
>> platforms is only anecdotal here.
>>
>> Just my 2 cents.
>>
>> H.
>>
>> On 08/25/2018 10:01 AM, Dirk Eddelbuettel wrote:
>>
>>>
>>> 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
>>>
>>>
>>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]



[Rd] Where does L come from?
William Dunlap