comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » double precision?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Double precision [message #65764 is a reply to message #49718] Thu, 19 March 2009 21:08 Go to previous messageGo to previous message
plim.dreaming is currently offline  plim.dreaming
Messages: 22
Registered: February 2008
Junior Member
Ahhhhhhhhhh..... one more thing to add to that page. Muito obrigado!
I do "need" to do it because i make a output with many columns and if
it isn't all in string format then IDL (always IDL's fault) moves to
the next line when it reaches the end of the page... as opposed to
only moving to the next line at the end of each line of data...
Anyway, i will go make the necessary changes and thanks again, i'm
mentioning this IDL crew in my PhD.
P

On Mar 19, 12:21 pm, David Fanning <n...@dfanning.com> wrote:
> plim.dream...@gmail.com writes:
>> Firstly say what is not the problem:
>> the problem in not in comparing the numbers.  I run one program which
>> reads in the file and does some stuff to the numbers and then outputs
>> to another file the selected array.  Only after do I read in the
>> selected array and perform separation comparisons.  The problem
>> already exists though in the output, since the numbers are truncated
>> or rounded off there.
>
>> And I really look at how I input the numbers and it seems fine.  I
>> read them in as double and then I print the numbers with 2f12.7 for
>> example and they are still fully there, not truncated.
>
>> I think the problem is in the printing to the output file.
>
>> I have x,y and they are numbers such as 100.912498
>> then I do a=strcompress(x)
>> openw,1,'fds'
>> printf,1,a
>
> Ah, I see. Well, STRING (which is what StrCompress has
> to call) is like PRINT: they have default formatting
> rules. In particular, they format to eight significant
> digits by default, unless they are told something different.
>
> But, first of all. Why in the world are you converting these
> to strings before you save them in the file!? That is a sure
> way to get in trouble, as you have discovered. If you *had*
> to do it, you could do it like this:
>
>    a = StrCompress(String(x, format='F0.10'), /Remove_all)
>
> But a much better way would just be to write them into the
> file without converting them to strings:
>
>    printf, x, Format='(F0.10)'
>
> Or, whatever format it is you think you want.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Mac Widget Limitation?
Next Topic: Re: Span a graph across 2 spaces in a !P.MULTI environment?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:06:42 PDT 2025

Total time taken to generate the page: 0.00835 seconds