[R] sprintf() question

Daniel Nordlund djnordlund at verizon.net
Mon May 18 00:03:19 CEST 2009

When I type the following, I get results different from what I expected. 

> sprintf('%a',3)
[1] "0x1.8"

Shouldn't the result be

[1] "0x1.8p+2"

I read through the help ?sprintf and didn't find anything that changed my expectation.  What am I misunderstanding?  I am using R-2.9.0 binary from CRAN on Windows XP Pro, and my session info is

> sessionInfo()
R version 2.9.0 (2009-04-17) 

LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

Thanks for any enlightenment.


Daniel Nordlund
Bothell, WA  USA

More information about the R-help mailing list