Re: Calculate the precision of a floating point number (ie: the number of decimal places)



Ed Prochak wrote:
Lori <steve.lori...@xxxxxxxxx> wrote:

I'm trying to write a reliable and efficient library function that
will calculate the precision of an input number (floating point).

IOW number of significant digits?

First, can you tell me how many significant digits exist in these
numbers
0.01e-21
0.00
0.000000

Yes. Just count the digits typed. The answers are 3, 3, 7.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages