formatting a float or double in a string with all significant digits kept

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Oct 10 22:44:05 UTC 2019


On Thu, Oct 10, 2019 at 09:13:05PM +0000, Jon Degenhardt via Digitalmars-d-learn wrote:
> On Thursday, 10 October 2019 at 17:12:25 UTC, dan wrote:
> > Thanks also berni44 for the information about the dig attribute, Jon
> > for the neat packaging into one line using the attribute on the
> > type.
> > Unfortunately, the version of gdc that comes with the version of
> > debian that i am using does not have the dig attribute yet, but
> > perhaps i can upgrade, and eventually i think gdc will have it.

What's the output of dmd --version?  I find it extremely odd that .dig
isn't supported.  AFAIK, it's been there since the early days of D.
Certainly, it has been there since I started using D, which was before
dmd was ever available in Debian.

What's the compiler output of:

	pragma(msg, float.dig);

?


T

-- 
Many open minds should be closed for repairs. -- K5 user


More information about the Digitalmars-d-learn mailing list