Displaying 20 results from an estimated 800 matches similar to: "formatReal()-bug (or Is there anybody out there w/o IEEE754?)"
2003 Jan 29
1
printing reals from C with digits
Hi,
I want to print real numbers in C code with different values for
digits. How to do that?
As I have understood, what I should do is to call
StringFromReal()
which calls FormatReal(), that one suggests the parameters (width,
decimal places and exponential form). FormatReal() includes
eps = pow(10.0, -(double)R_print.digits);
So I guess I have to change the value of R_print.digits.
2002 Aug 13
2
Misalignment of <NA> in rownames (PR#1905)
An NA in the rownames of a matrix (or dataframe) causes misalignment when the
matrix is printed:
R> x <- matrix(1:12, 3,4, dimnames=list(letters[1:3], LETTERS[1:4]))
R> rownames(x)[2] <- NA
R> x
A B C D
a 1 4 7 10
<NA> 2 5 8 11
c 3 6 9 12
The bug is in function Rstrlen, in src/main/printutils.c. MatrixRowLabel and
MatrixColumnLabel (same file) rely on Rstrlen
2003 May 02
2
Suppressing Scientific Notation
R gurus,
Every so often(*) someone asks how to suppress scientific notation in
printing, so I thought I'd give it a shot, but I need some help.
The formatting decision is made(**) on line 286 of src/main/format.c :
if (mF <= *m) { /* IFF it needs less space : "F" (Fixpoint) format */
where mF is the number of characters for "normal" printing and *m is the number
2003 Feb 02
1
printing reals from C with digits -- once more
Thank for Brian D. Ripley for the answer to my previous question.
My aim is to print single values from different real vectors with
different digits option. This is quite a possible with Rprintf() but
that one supprots printing format as C does, not in R native way
(setting digits=7 or printing with "%12.7f" are two quite different
things). So I would like to find something more
2008 Feb 29
1
patch for random.c
Dear all,
while looking for some inspiration of how to organise some code, I
studied the code of random.c and noticed that for distributions with
2 or 3 parameters the user is not warned if NAs are created while such
a warning is issued for distributions with 1 parameter. E.g:
R version 2.7.0 Under development (unstable) (2008-02-29 r44639)
[...]
> rexp(2, rate=Inf)
[1] NaN NaN
Warning
2015 Jun 13
2
Lack of protection bug in current R release candidate
The current R release candidate has a lack of protect bug (of very
long standing) with respect to the R_print.na_string and
R_print.na_string_noquote fields of the static R_print structure
declared in Print.h. This shows up very occassionally as incorrect
output from the following lines in reg-tests-2.R:
x <- c("a", NA, "b")
factor(x)
factor(x, exclude="")
2013 Aug 15
1
format bug and patch
Dear R-team,
I've been using R for a while and decided to contribute some bug
fixes. The first bug I tried to solve was
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15411
I have attached a patch with the fix to the bug and would love to hear
comments about its quality.
Also, while testing this bug I found another related issue:
> format(complex(real=10, imaginary=4), digits = 1);
1999 Oct 15
2
IEEE_754 logic
Can anybody of the architects of R enlighten me about the reasoning behind the selection of the IEEE 754
mode for the building of R, please?
Special points of interest are:
1. The selection seems to be based on the availability of isnan() and finite(). Is this a common way
to test for IEEE 754?
2. The C9x draft introduces isfinite() instead of finite() (and as I see, some systems, e.g. the
2020 Sep 04
4
Misleading documentation on FP to integer conversion instructions?
If fptosi takes 0.9 -> 0, then that is not 'rounding' in any sense I'm
aware of (IEEE754 or otherwise).
Rounding (in the IEE754 sense) determines how a number is converted when it
is halfway between two
candidate results. (see round(), ceil(), floor()).
fptosi seems to model the behavior of a C cast from float to int,
which truncates the fractional bits (as in trunc()).
Steve
2017 Nov 09
1
formatting raw vectors with names
I think there?s a bug concerning the formatting of raw vectors with names:
> structure(as.raw(1:3), .Names = c("a", "bbbb", "c"))
a bbbb c
01 02 03
> structure(1:3, .Names = c("a", "bbbb", "c"))
a bbbb c
1 2 3
The problem is that EncodeRaw does not honor the requested width, in fact it doesn?t even get the
2016 Mar 18
1
formatting of complex matrix
While working on the printing code, my colleague Zbyn?k ?lajchrt noticed that complex matrixes are sometimes misaligned:
> { matrix(1i,2,13) }
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
[2,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
(the values in the last four columns
2020 Sep 04
2
Misleading documentation on FP to integer conversion instructions?
The LLVM IR reference manual states, for fptosi:
"The ‘fptosi’ instruction converts its floating-point
<http://llvm.org/docs/LangRef.html#t-floating> operand into the nearest
(rounding towards zero) signed integer value."
I interpreted this to mean that it rounds:
The nearest integer to 0.3 is 0.
The nearest integer to 0.9 is 1.
The nearest integer to 0.5 is either 0 or 1. And
1999 Mar 12
1
R 68.3 on OSF V4.0 problems
I am trying to install R-0.63.3 on a Digital Alpha running OSF V4.0D, and
having some difficulties. Can anyone help?
Also, I found some "oddities" in the installation process. I expect that
this message is read by the developers, maybe some of my suggestions can be
incorporated into future releases.
Please reply to me directly (as well as possibly also to this mailing list):
I am not a
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
Function factor() in the current development version (2009-05-22)
guarantees that levels are different character strings. However, they
may represent the same decimal number. The following example is derived
from a posting by Stavros Macrakis in thread "Match .3 in a sequence"
in March
nums <- 0.3 + 2e-16 * c(-2,-1,1,2)
f <- factor(nums)
levels(f)
# [1]
2014 Sep 18
2
formatR 1.0 caused error
Recently in our R 3.1.0 installation the package formatR was upgraded to version 1.0, doing my usual thing, I got the following error, and the destination html file was not generated.
What can I do if I want to stay at the current formatR version?
Jun
Error: unrecognized fields specified in html_dependency: attachment
In addition: Warning messages:
1: 'function (...)
{
2010 Apr 13
1
formatR: farewell to ugly R code
This is an announcement of the release of an R package 'formatR',
which can help us format our R code to make it more human-readable. If
you have ugly (I mean unformatted) R code like this:
?# rotation of the word "Animation"
# in a loop; change the angle and color
# step by step
for (i in 1:360) {
? # redraw the plot again and again
2010 Apr 13
1
formatR: farewell to ugly R code
This is an announcement of the release of an R package 'formatR',
which can help us format our R code to make it more human-readable. If
you have ugly (I mean unformatted) R code like this:
?# rotation of the word "Animation"
# in a loop; change the angle and color
# step by step
for (i in 1:360) {
? # redraw the plot again and again
2010 Dec 03
0
formatR update (0.1-5)
In formatR 0.1-5, the dependency on the gWidgets and animation
packages are removed. The GUI by gWidgets is optional now.
Meanwhile, the function tidy.source() has been moved from the
animation package to this package.
> library(formatR)
> tidy.source(textConnection('
# rotation of the word "Animation"
# in a loop; change the angle and color
# step by step
for (i in
2010 Dec 03
0
formatR update (0.1-5)
In formatR 0.1-5, the dependency on the gWidgets and animation
packages are removed. The GUI by gWidgets is optional now.
Meanwhile, the function tidy.source() has been moved from the
animation package to this package.
> library(formatR)
> tidy.source(textConnection('
# rotation of the word "Animation"
# in a loop; change the angle and color
# step by step
for (i in
2010 Apr 19
1
Follow up on installing formatR...
Good morning folks:
Made a second go at installing this and succeeded, but with some strange
behaviours along the way. First the system back story.
Using up to date edition Ubuntu 8.04
Using up to date edition of R 2.10.1
Using the Toronto, Ontario repository to draw from.
After the first attempt ended up with two of the four dependencies
installed so only the Rgtk related items would be