From 538280 at gmail.com  Tue Jun 30 19:29:18 2015
From: 538280 at gmail.com (Greg Snow)
Date: Tue, 30 Jun 2015 11:29:18 -0600
Subject: [Rd] Why doesn't R have a float data type?
In-Reply-To: <CAKxd1KM9Ktmh3Aa_bYpbA1w3xAY=ZWpStLmzGhduYfzFZf_OeA@mail.gmail.com>
References: <CAKxd1KM9Ktmh3Aa_bYpbA1w3xAY=ZWpStLmzGhduYfzFZf_OeA@mail.gmail.com>
Message-ID: <CAFEqCdyWCA2QXCW89fpRNibCZP8y716ODgt28tTpJ=LRwq47zg@mail.gmail.com>

My understanding is that R does have a float type, it is just called
"double" instead of "float".

If you are referring to a single precision floating point type, then R
does have the "as.single" function, but that does not really change
the way the number is stored, just sets a flag so that the proper
conversion is done when passing to the ".C" or ".fortran" functions.
The original S language and S+ would store things in single precision
if needed, but for computations these values were almost always
converted to doubles for precision.  By the time R was developed the
memory saving of using single precision instead of double precision
was not as big an issue, so I expect that nobody ever considered it
worth the effort to fully implement the single precision storage.

If you mean something else other than the above by "float data type"
then please give us more details so that we can better answer the
question.

On Tue, Jun 30, 2015 at 10:42 AM, Charles Determan
<cdetermanjr at gmail.com> wrote:
> This is strictly a curiosity question.  I am aware the R doesn't possess a
> float data type.  I also don't mean to request that such functionality be
> implemented as I'm sure it would require a large amount of work with
> potential back compatibility conflicts.  But I wanted to know why R has
> never had a float data type available?
>
> Regards,
> Charles
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com



[Rd] Why doesn't R have a float data type?
Greg Snow