Re: [R] floating point in single precision

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sun, 27 Jun 2010 07:39:10 +0100 (BST)

On Sun, 27 Jun 2010, Sebastian Gibb wrote:

> Hello,
>
> is there a possibilty in R to convert numbers (double precision, 64bit) into
> single precision ones (32bit).
> I need that for compatibility reasons. Until now I call a C application which
> casts a double to a float.
>
> float precision32(double value) {
> return (float)value;
> }
>
> But I want to use a R only method. What can I do?

?as.single
?writeBin

> Kind regards,
>
> Sebastian

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 27 Jun 2010 - 06:42:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jun 2010 - 00:50:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive