search for: ncg_goldberg

Displaying 15 results from an estimated 15 matches for "ncg_goldberg".

2007 Jun 11
2
Rounding?
I was a bit puzzed by: > formatC(6.65,format="f",digits=1) [1] "6.6" So I experimented and found: > formatC(6.6500000000000001,format="f",digits=1) [1] "6.6" > formatC(6.650000000000001,format="f",digits=1) [1] "6.7" > round(6.6500000000000001,1) [1] 6.7 > round(6.650000000000001,1) [1] 6.7 > version
2004 Jan 26
0
Significances of Korrelations and Sweave
...}{$M$} & \multicolumn{1}{r}{$SD$} & \multicolumn{1}{r}{Varianz} \ML <<echo=false,results=tex>>= for (i in 3:ncol(scales)) { ... } @ \LL } LaTeX gives me an Error when there is an environment inside ctable. Thanks in advance. [1] http://docs.sun.com/source/806-3568/ncg_goldberg.html Stefan
2004 Dec 14
1
increase thr range in R
Hello Everybody in order to get some needed results out of my function i need to get my besselI function evaluated at some values which normally gave Inf or 0 (expon.scaled NAN) back. So I would like to increase the range in R from approxamittly 1e+320 to aabout 1e+500 or something like that. Is there any possibility or pacckage to do this easily? Thank You Sebastian Kaiser Institut for Statistics
2008 Jul 17
0
Re : float and double precision with C code
...voy? le : Jeudi, 17 Juillet 2008, 14h56mn 01s Objet : Re: [R] float and double precision with C code FAQ 7.31 Also read "What Every Computer Scientist Should Know About Floating-Point Arithmetic", ACM Computing Surveys, 23/1, 5?48, also available via http://docs.sun.com/source/806-3568/ncg_goldberg.html. On Thu, Jul 17, 2008 at 8:47 AM, JS Ubei <jsubei at yahoo.fr> wrote: > Hi all, > > There is a mistake for wich I need your ligths : > > /////////////////////////////////////// > > I have a small C code : > > SEXP testData() > { > SEXP result; >...
2011 Apr 24
2
random roundoff?
On my CentOS 5 box, in a C++ program that does much arithmetic, including numerous matrix multiplications, I have a situation in in which the result depends on the nature of nearby I/O. Thus, with all arithmetic done with type double, and where values are mostly in the range [-1.0e0,+1.0e0] or nearby, I do: cerr << "some stuff" << endl; mat3 = matmult(mat1,mat2); I
2007 Sep 24
2
a bug when subtracting vectors?
Hi, I am calling in some data into R via the read.table function. The 'tail' of this data reads > tail(data) Date Open High Low Close Volume 3728 Fri 14-Sep-07 114.19 114.46 113.93 114.08 1117992 3729 Mon 17-Sep-07 113.99 114.37 113.91 114.27 899671 3730 Tue 18-Sep-07 114.30 114.32 113.47 113.85 1346282 3731 Wed 19-Sep-07 113.71 113.71
2005 Aug 16
2
bug? (PR#8074)
Full_Name: Paul Mosquin Version: 2.1.1 OS: Windows XP Submission from: (NULL) (24.225.66.48) I just don't understand this: >(2*2)==4 [1] TRUE > .2*.2 [1] 0.04 > (.2*.2)==.04 [1] FALSE or > x=.04 > x [1] 0.04 > y=.2*.2 > y [1] 0.04 > y==x [1] FALSE
2008 Jul 17
0
Re : Re : float and double precision with C code
...voy? le : Jeudi, 17 Juillet 2008, 14h56mn 01s Objet : Re: [R] float and double precision with C code FAQ 7.31 Also read "What Every Computer Scientist Should Know About Floating-Point Arithmetic", ACM Computing Surveys, 23/1, 5?48, also available via http://docs.sun.com/source/806-3568/ncg_goldberg.html. On Thu, Jul 17, 2008 at 8:47 AM, JS Ubei <jsubei at yahoo.fr> wrote: > Hi all, > > There is a mistake for wich I need your ligths : > > /////////////////////////////////////// > > I have a small C code : > > SEXP testData() > { > SEXP result; >...
2005 Oct 11
3
Is this correct?
Dear userR, With the following results, are they correct or acceptable? > x <- c(1.4, 1.2, 2.8) > sum(x) [1] 5.4 > sum(x) == 5.4 [1] FALSE > (1.4 + 1.2 + 2.8) - 5.4 [1] -8.881784e-16 > (1.4 + 1.2) - 2.6 [1] -4.440892e-16 > 2.6 - 1.5 - 1.1 [1] 0 > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor
2003 Mar 15
3
round() seems inconsistent when rounding 5s
It may be my lack of unerstanding, but round() seems to me to give inconsistent results when rounding 5s as in the following examples? > round(1.45, 1) [1] 1.4 # OK > round(2.45, 1) [1] 2.5 # shouldn't this be 2.4? > round(1.05, 1) [1] 1.1 # 1.0 ? and signif(): > signif(2.445, 3) [1] 2.44 # OK > signif(3.445, 3) [1]
2008 Jul 17
5
calculate differences - strange outcome
Dear List, I ran into some trouble by calculating differences. For me it is important that differences are either 0 or not. So I don't understand the outcome of this calculation 865.56-(782.86+0+63.85+18.85+0) [1] -1.136868e-13 I run R version 2.71 on WinXP I could solve my problem by using round() but I would like to know the reason. Maybe someone can help me? Thanx
2004 Nov 11
5
wrong answer for simple expressions
I am experiencing strange (to me) output when trying to do simple calculations. Expressions that should equal zero yield non-zero values. Examples: > a <- 4.1-3.1 > b <- 5.1-4.1 > a-b [1] -4.440892e-16 > (4.1-3.1)-(5.1-4.1) [1] -4.440892e-16 When this last expression is expanded, I get the right answer: > 4.1-3.1-5.1+4.1 [1] 0 I am using the binary packaged version
2005 Nov 01
5
Unexpected result from binary greater than operator
Hi All, I recently encountered results that I did not expect, exhibited by the following code snippet: test <- function() { minX <- 4.2 min0 <- 4.1 sigmaG <- 0.1 Diff <- minX-min0 print(c(Diff=Diff,sigmaG=sigmaG)) cat("is Diff > sigmaG?:", Diff > sigmaG,"\n") cat("is (4.2 - 4.1) > 0.1?:",(4.2 - 4.1) >
2010 Jun 24
5
Best way to compute a sum
> a <- 0 ; for(i in (1:200000000)) a <- a + 1/i > b <- 0 ; for(i in (200000000:1)) b <- b + 1/i > c <- sum(1/(1:200000000)) > d <- sum(1/(200000000:1)) > order(c(a,b,c,d)) [1] 1 2 4 3 > b<c [1] TRUE > c==d [1] FALSE I'd expected b being the largest, since we sum up the smallest numbers first. Instead, c is the largest, which is
2007 Jan 20
4
Question about converting from square roots to decimals and back
Hi, I apologize if there is a simple answer to this question that I've missed. I did search the mailing list but I might not have used the right keywords. Why does sum(A3^2) give the result of 1, but sum(A3^2)==1 give the result of FALSE? > A3<-matrix(nrow=3,c(1/(2^.5),1/(2^.5),0)) > A3 [,1] [1,] 0.7071068 [2,] 0.7071068 [3,] 0.0000000 > sum(A3^2) [1] 1 >