> Actually (after some trials) there is a little problem when faced with
> zeros...
>
> >getndp(1.0)
> [1] 0
Are you sure this isn't what you want? 1.0 is just 1 in disguise, and
round(1.0, 0) is the same as round(1.0, 1) anyway.
> Note that I thought on a very different way which was starti
Matthieu Stigler a e'crit :
> [EMAIL PROTECTED] a e'crit :
What I mean is if R shows 2.3456 I want to obtain the info that
>> digits=4
even if in facts the value has more (internal) digits.
>>> Try:
>>> x = 1.23456789
>>> format(x, nsmall=20)
>>> # [1] "1.2345678899989009"
>>
>> I've
[EMAIL PROTECTED] a e'crit :
>>> What I mean is if R shows 2.3456 I want to obtain the info that
>>>
> digits=4
>
>>> even if in facts the value has more (internal) digits.
>>>
>> Try:
>> x = 1.23456789
>> format(x, nsmall=20)
>> # [1] "1.2345678899989009"
>>
>
> I've ju
> > What I mean is if R shows 2.3456 I want to obtain the info that
digits=4
>
> > even if in facts the value has more (internal) digits.
>
> Try:
> x = 1.23456789
> format(x, nsmall=20)
> # [1] "1.2345678899989009"
I've just re-read the question. I suspect what you really wanted was
som
> I need it to solve the problem (see RFAQ 7.31)that 0.2==0.2+0.1-0.1
FALSE
> The solution suggested in RFAQ is to use
isTRUE(all.equal(0.2,0.2+0.1-0.1))
>
> But if I want to compare inequality:
> 0.2<=0.2 +0.1-0.1 TRUE
> but 0.2<=0.2 +0.1-0.1 FALSE
> bad!
> but in this case all.equal does not w
Hello dear R users!
I did not find a function which gives information about the number of
digits of a value shown by R.
Do you know one?
I need it to solve the problem (see RFAQ 7.31)that 0.2==0.2+0.1-0.1 FALSE
The solution suggested in RFAQ is to use isTRUE(all.equal(0.2,0.2+0.1-0.1))
But if I
6 matches
Mail list logo