Displaying 2 results from an estimated 2 matches for "floating_point_math".
2005 Sep 13
1
Floating-point arithmetic
...re:
What Every Computer Scientist Should Know About
Floating-Point Arithmetic, by David Goldberg,
originally published in the March, 1991 issue of Computing Surveys.
PDF and HTML versions are widely available on the web (see Google),
e.g. at
http://www.physics.ohio-state.edu/~dws/grouplinks/floating_point_math.pdf
Though over the years I've many times been there, done that,
got bitten by the bugs, and bought the T-shirt [I have one from
Florida depicting a large and joyful mosquito with proboscis
dripping with blood] I still found this a revealing read, written
in a style well-suited to general user...
2006 Oct 21
4
one is not one
Folks,
I have got a strange behaviour when testing this:
sum(x) != 1
let us set
x<-c(70,134,1,5,0)
and transform it in a vector of probabilities
x<-x/sum(x)
One expect sum(x) should be equal to 1, which is apparently the case
> sum(x)
[1] 1
However, when I try to test it I get:
> if(sum(x) !=1) print("lost") else ("OK")
[1] "lost"
Which means