From n@k@m@ @ending from ki@rim@or@jp  Tue Jul 10 06:07:02 2018
From: n@k@m@ @ending from ki@rim@or@jp (Ei-ji Nakama)
Date: Tue, 10 Jul 2018 13:07:02 +0900
Subject: [Rd] problem with display of complex number
Message-ID: <CAJqeyYbp9fqJSx6KrgEx9Q_WOSKF5Sr6a2CBYD+Jsf1fm6cVQQ@mail.gmail.com>

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>



[Rd] problem with display of complex number
Ei-ji Nakama