Trying algorithm for products with large numbers i encountered a difference between result of 168988580159 * 36662978 in my algorithm and r product. The Microsoft calculator confirm my number. Thanks. -- * Gr?fica ARTENTOR * de Diego L. Tentor Echag?e 558 Tel.:0343 4310119 Paran? - Entre R?os
Wow do you trust Windows calculator with those large numbers???? In fact do you at all trust Windows calculator??? Try to do this calculation 3 +8*5 in windows calculator. In standard view you get 55 In scientific view you get 43. Try it yourself!!!!!! Do you know the right answer????? This is on my Windows 8 OS, but you can track it many years back!!!!!! Yours sincerely / Med venlig hilsen Frede Aakmann T?gersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 frtog at vestas.com http://www.vestas.com Company reg. name: Vestas Wind Systems A/S This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice If you have received this e-mail in error please contact the sender.> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of ARTENTOR Diego Tentor > Sent: 4. maj 2014 14:44 > To: r-help at r-project.org > Subject: [R] Problem with products in R ? > > Trying algorithm for products with large numbers i encountered a difference > between result of 168988580159 * 36662978 in my algorithm and r product. > The Microsoft calculator confirm my number. > > Thanks. > > > > > -- > > > * Gr?fica ARTENTOR * > > de Diego L. Tentor > Echag?e 558 > Tel.:0343 4310119 > Paran? - Entre R?os
On 04 May 2014, at 14:44 , ARTENTOR Diego Tentor <diegotentor71 at gmail.com> wrote:> Trying algorithm for products with large numbers i encountered a difference > between result of 168988580159 * 36662978 in my algorithm and r product. > The Microsoft calculator confirm my number. >> 168988580159 * 36662978[1] 6.195625e+18 That value exceeds the relative precision of floating point numbers (approx 1e-16), so the last few digits are likely to differ from an exact calculation. The "gmp" package is there if you need it.> Thanks. > > > > > -- > > > * Gr?fica ARTENTOR * > > de Diego L. Tentor > Echag?e 558 > Tel.:0343 4310119 > Paran? - Entre R?os > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Try options(digits = 22) 168988580159 * 36662978 # [1] 6195624596620653568 HTH, Jorge.- On Sun, May 4, 2014 at 10:44 PM, ARTENTOR Diego Tentor < diegotentor71@gmail.com> wrote:> Trying algorithm for products with large numbers i encountered a difference > between result of 168988580159 * 36662978 in my algorithm and r product. > The Microsoft calculator confirm my number. > > Thanks. > > > > > -- > > > * Gráfica ARTENTOR * > > de Diego L. Tentor > Echagüe 558 > Tel.:0343 4310119 > Paraná - Entre Ríos > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >[[alternative HTML version deleted]]
In R, all number (integer float double precision) is treated as double precision. Therefore, it has only 16 significant figures. To achieve higher precision, you have to use program support long integer ? 2014?5?4????UTC+8??8?44?04??ARTENTOR Diego Tentor???> > Trying algorithm for products with large numbers i encountered a > difference > between result of 168988580159 * 36662978 in my algorithm and r product. > The Microsoft calculator confirm my number. > > Thanks. > > > > > -- > > > * Gr?fica ARTENTOR * > > de Diego L. Tentor > Echag?e 558 > Tel.:0343 4310119 > Paran? - Entre R?os >