From: Mike Rose
Subject: How to format to maximize significant figures
Date:
Message-ID: <1404@stsci.edu>
I'm writing a common lisp routine to print floating point numbers
so that the use of available space is maximized. The
requirements are: flonums should be printed in fixed-format
floating point in a field w characters wide. If the fixed-format
representation doesn't fit in w characters, or if exponential
floating-point shows more significant figures in w characters,
then use exponential floating-point. If the number can't show at
least one significant figure in either-fixed format or
exponential, use fixed format in as wide a field as necessary.
This must be machine-independent.
Does anyone have a good way to do this?
~G looked like a good possibility, but it leaves space for the
exponent even when one isn't used. Maybe there's something
really clever I can do with it?
Thanks,
Mike Rose
·····@stsci.edu