Re: Displaying floating point values with user specified decimal places? [message #43282] |
Fri, 25 March 2005 16:12 |
Jonathan Greenberg
Messages: 91 Registered: November 2002
|
Member |
|
|
My brain just exploded.
With that said, that did help me find the issue!
--j
On 3/25/05 3:55 PM, in article MPG.1cae52c520d07b41989999@news.frii.com,
"David Fanning" <davidf@dfanning.com> wrote:
> Jonathan Greenberg writes:
>
>> How do I control how a system works with decimal places for floating point
>> values? For instance, I did a few fltarr assigns which end up displaying
>> (via print,array) a longish floating point value without the decimals which
>> I know are there (e.g. 657456. vs the "true" value of 657456.25), or in
>> scientific number format -- when I go to use, for instance, Dave Fannings
>> write_csv_data.pro, it writes the array out in the same format that
>> print,array spits out. How do I control this decimal display format?
>
> I think you might be ready for this article:
>
> http://www.dfanning.com/math_tips/sky_is_falling.html
>
> Have a look at the FORMAT keyword for both PRINT and PRINTF,
> then think about how many significant digits you can display
> in a float with computers. You may have to re-think your
> notion of a "true value". :-)
>
> Cheers,
>
> David
|
|
|
Re: Displaying floating point values with user specified decimal places? [message #43285 is a reply to message #43282] |
Fri, 25 March 2005 15:55  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jonathan Greenberg writes:
> How do I control how a system works with decimal places for floating point
> values? For instance, I did a few fltarr assigns which end up displaying
> (via print,array) a longish floating point value without the decimals which
> I know are there (e.g. 657456. vs the "true" value of 657456.25), or in
> scientific number format -- when I go to use, for instance, Dave Fannings
> write_csv_data.pro, it writes the array out in the same format that
> print,array spits out. How do I control this decimal display format?
I think you might be ready for this article:
http://www.dfanning.com/math_tips/sky_is_falling.html
Have a look at the FORMAT keyword for both PRINT and PRINTF,
then think about how many significant digits you can display
in a float with computers. You may have to re-think your
notion of a "true value". :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|