[R] Function of "matrix"

Bill Dunlap w||||@mwdun|@p @end|ng |rom gm@||@com
Thu Oct 22 21:24:25 CEST 2020


>  10.1/0.1 was successfully calculated

  Note that 'computed as' is not the same as 'printed as'.   Computations
are
done with 52 binary digits of precision and printing is, by default, done
with
7 decimal digits of precision.  See FAQ 7.31.

> 101 - 10.1/0.1
[1] 1.421085e-14
> options(digits=17)
> 10.1/0.1
[1] 100.99999999999999
> trunc(10.1/0.1)
[1] 100

On Thu, Oct 22, 2020 at 11:42 AM 奈良県奈良市 <jaajikan using gmail.com> wrote:

> Dear R project team
>
> I used the function of "matrix" as follows:
> matrix(c(1:3030), 10.1/0.1)
> However, in the function, matrix, 10.1/0.1 was regarded as 100 not as 101.
> Therefore, a warning message appeared.
> On the other hand, matrix(c(1:3030), 101) or matrix(c(1:3030), 10.1*10) was
> OK. Of course, simply, 10.1/0.1 was successfully calculated. However,
> In the "matrix" environment, 10.1/0.1 was calculated as 100.
>
> Would you give me some answers?
>
> Sincerely
>
> Kazuki Sakura
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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]]



More information about the R-help mailing list