Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Mathew Hendry <scampi@dial.pipex.com>
Subject: Re: print long double on Tru64 Unix5.0
Date: 2000/07/12	[thread overview]
Message-ID: <pcjpmsom2ua0501p3dr9vqjp6mcj48n9s7@4ax.com> (raw)
In-Reply-To: 8kig92$mhi$1@news6.isdnet.net

On Wed, 12 Jul 2000 21:13:38 +0200, "Mickael GASTINEAU" <amgastineau@voonoo.net>
wrote:

>I have some trouble to print long double data on Tru64 Unix5.0A with the
>system call printf(3).
>After the 16th digit, it always print 0 for the digits.
>But long double has about 33 significant digits on Tru64Unix5.0A.
>[...]

You need a better standard C library.

The simplest approach to printing a floating point number is to scale the number
by powers of 10 into the range of the largest available integer type, then to
convert that to a string, giving a decimal significand.

If you're only getting 16 decimal digits, it's probably because your library is
using a 64-bit integer for the intermediate representation. Other libraries
(e.g. glibc) use arbitrary precison integer arithmetic to give effectively
unlimited precision.

-- Mat.




  reply	other threads:[~2000-07-12  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-12  4:00 print long double on Tru64 Unix5.0 Mickael GASTINEAU
2000-07-12  4:00 ` Mathew Hendry [this message]
2000-07-14  4:00 ` Joe Mario
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox