[Rd] problem with display of complex number

Ei-ji Nakama n@k@m@ @ending from ki@rim@or@jp
Tue Jul 10 06:07:02 CEST 2018


Hi,

> 1e10+5i
[1] 1e+10+0e+00i
> Im(1e10+5i)
[1] 5

maybe little better...

--- R-3.5.1.orig/src/main/complex.c    2018-03-26 07:02:25.000000000 +0900
+++ R-3.5.1/src/main/complex.c    2018-07-10 12:50:42.523874767 +0900
@@ -381,6 +381,7 @@
     r->i = fround(pow10 * x->i, digits)/pow10;
     } else {
     digits = (double)(dig);
+    if(digits < 1) digits=1; /* a little better */
     r->r = fround(x->r, digits);
     r->i = fround(x->i, digits);
     }


-- 
Best Regards,
-- 
Eiji NAKAMA <nakama (a) ki.rim.or.jp>
"\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>



More information about the R-devel mailing list