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

Home » Public Forums » archive » Re: Command line display format
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: Command line display format [message #75770 is a reply to message #75768] Wed, 04 May 2011 12:06 Go to previous messageGo to previous message
Ammar Yusuf is currently offline  Ammar Yusuf
Messages: 36
Registered: October 2010
Member
On May 4, 3:01 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On May 4, 3:56 pm, Ammar Yusuf <amyus...@gmail.com> wrote:
>
>> Hi, so I did this in the command line:
>> IDL> print, wave_special[2], wave_special[1], wave_special[2]-
>> wave_special[1]
>>       1260.20      1260.10    0.0999756
>
>> I was hoping it would print out 0.10 but it's something really close.
>> How can I display in my command line the actual values of
>> wave_special. I know in Matlab you can type format short, format long,
>> to do it.
>
>> Is using the print format the only way to see? Thanks!
>
> If what you are looking for is format control, you can use the format
> keyword to print. Using Fortran-style formats, it could be something
> like:
>
> print,wave_special[2], wave_special[1], wave_special[2]-
> wave_special[1],format='(3E22.15)'
>
> See the help on print for more details on format codes, including how
> to use C-style formats.

Oh okay. Do you know why this happened or is this just part of
floating point representation?
I would expect 1260.20 - 1260.10 to return 0.1.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Command line display format
Next Topic: 3d visualization

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

Current Time: Fri Oct 10 04:50:42 PDT 2025

Total time taken to generate the page: 1.03507 seconds