[Nickle] printing in scientific notation

Keith Packard keithp at keithp.com
Mon Apr 26 05:51:55 PDT 2004


Around 23 o'clock on Apr 24, burgess at rpi.edu wrote:

> Is there any way in Nickle to print out a number in scientific notation? For
> example, I have a real storing the value 2.5e11, and I would like to print that
> out instead of 250000000000. C-style printf has an "e" format that would do
> this.

Nickle has 'e' format, but it it's broken for whole number values.

Try:

> printf ("%e\n", pi * 1e10);
3.141592653589793e10
> 

Looks like IntegerPrint and IntPrint need to be "fixed"...

-keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : /pipermail/nickle/attachments/20040426/79cbd253/attachment.pgp


More information about the Nickle mailing list