[R] extra .

William Dunlap wdunlap at tibco.com
Fri Aug 21 17:48:15 CEST 2009

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of kfcnhl
> Sent: Thursday, August 20, 2009 7:34 PM
> To: r-help at r-project.org
> Subject: [R] extra .
> sigma0 <- sqrt((6. * var(maxima))/pi)
> What does the '.' do here?

In R it does nothing: both '6' and '6.' parse as "numerics"
(in C, double precision numbers).  In SV4 and S+ '6' parses
as an integer (in C, a long) and '6.' parses as a numeric,
so putting the decimal point after numerics makes the
code a bit more portable, although there are not too many
cases where the difference is significant.   Calls to .C, etc.,
and oveflowing arithmetic are the main problem points.

In R and S+ '6L' represents an integer.

S+'s parse has a parse.mode="R" argument that parses
text more like R does: '6' is a numeric, '_' is not the assignment
operator, && has higher precedence than ||, etc.

> -- 
> View this message in context: 
> http://www.nabble.com/extra-.-tp25073255p25073255.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> 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.

More information about the R-help mailing list