[Rd] Floating point issue

Antoine Fabri @nto|ne@|@br| @end|ng |rom gm@||@com
Sun Jul 10 17:43:03 CEST 2022


He is my session info :

R version 4.1.3 (2022-03-10)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.0.1

Le dim. 10 juil. 2022 à 16:44, Iñaki Ucar <iucar using fedoraproject.org> a
écrit :

> On Sun, 10 Jul 2022 at 16:28, GILLIBERT, Andre
> <Andre.Gillibert using chu-rouen.fr> wrote:
> >
> > > No, that is how computers work (with floating point numbers).
> >
> >
> > The fact that not all values are representable by floating point does
> not mean that outputing a number with maximum accuracy, then reading it
> back, should yield a different number.
> >
> >
> > I would like to point that I cannot reproduce this "bug" on the official
> R 4.2.0 Windows x86_64 build on an AMD Ryzen 1700 on Windows 10.
>
> I cannot reproduce this on a 64-bit Linux build of R 4.1.3 either:
>
> options(scipen = 999)
> 1e24
> #> [1]  999999999999999983222784
> 1e24 == 999999999999999983222784
> #> [1] TRUE
>
> 1e25
> #> [1] 10000000000000000905969664
> 1e25 == 10000000000000000905969664
> #> [1] TRUE
>
> 10000000000000000905969664
> #> [1] 10000000000000000905969664
>
> 10000000000000003053453312
> #> [1] 10000000000000003053453312
>
> 10000000000000000000000000 == 1e25
> #> [1] TRUE
>
> --
> Iñaki Úcar
>

	[[alternative HTML version deleted]]



More information about the R-devel mailing list