[Rd] a little bug for the function 'sprintf' (PR#14161)

From: <baoliqin_at_gmail.com>
Date: Mon, 21 Dec 2009 13:00:10 +0100 (CET)


ink1">ink1">Dear R-ers,

I am a gratuate student from South China University of Technology. I fond the function 'sprintf' in R2.10.1 have a little bug(?):

When you type in the example codes:

> sprintf("%s is %f feet tall\n", "Sven", 7.1)

ink2">and R returns:

[1] "Sven is 7.100000 feet tall\n"

this is very different from the 'sprintf' function in C/C++, for in C/C++, the format string "\n" usually represents a new line, but here, just the plain text "\n"!

Is it a bug, or a deliberate design?

Thanks for your attention!

ink3">Best wishes!

Yours sincerely,
Baoli Qin

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 21 Dec 2009 - 17:14:41 GMT

This archive was generated by hypermail 2.2.0 : Mon 21 Dec 2009 - 18:21:21 GMT