[Scilab-users] Increase Computing Precision beyon Double // Big Integers?
Станислав
krotersv at gmail.com
Fri Jun 28 10:57:33 CEST 2013
28.06.2013 14:26, Sandro Hardy пишет:
> Hello everyone,
>
> is it there a way to increase the computing precision in Scilab beyond
> the regular "double precision"?
>
> In Scilab this example gives me a wrong result:
> -->290017/10000
> ans =
>
> 29.001699999999999590727
>
> R is more accurate (Matlab also):
> > 290017/10000
> [1] 29.0017
>
> In R I can even increase the precison:
> > options(digits=10)
>
> Is this also possible with Scilab?
>
> Similar question for big numbers, is there a "standard" solution for
> this (BigIntegers)?
>
> In Scilab:
> -->a=635037699992127443
> a =
>
> 635037699992127488.
>
> -->b=635037699992127444
> b =
>
> 635037699992127488.
>
> -->a-b
> ans =
>
> 0.
>
> I would expect a warning, but I get get a wrong result. At least the
> output gives me the hint, that the variable was not set accurately.
>
> The solution is called bigz in R (VPI in Matlab) and work like this:
>
> > a=as.bigz('635037699992127443');
> > b=as.bigz('635037699992127444');
> > a-b
> Big Integer ('bigz') :
> [1] -1
>
> Thanks in advance for any hints.
>
> Sandro
>
>
Hi.
I suppose it is common problem of representation of floating point numbers.
Actually, I don't think that Matlab is more accurate. There is an
interest document
http://www.scilab.org/content/download/395/2850/file/ScilabTec_Keynote.pdf
.
Stanislav
More information about the users
mailing list