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

Home » Public Forums » archive » Casting floating point number into e-notation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Casting floating point number into e-notation [message #4562] Thu, 08 June 1995 00:00
cavanaug is currently offline  cavanaug
Messages: 18
Registered: December 1994
Junior Member
Please, please, please somebody tell me what I'm doing wrong with
my attempt to cast a floating point value into e-notation (using
our old buddy IDL) :

IDL> a = 3.567
IDL> print, size(a)
0 4 1
IDL> print, a
3.56700
IDL> b = strtrim (a, 2)
IDL> print, size(b)
0 7 1
IDL> print, b
3.56700
IDL> print, format = '(e11.4)', a
3.5670e+00
IDL> print, format = '(e11.4)', b
3.5670e+00
IDL> c = 0.0
IDL> reads, format = '(e11.4)', a, c
IDL> print, size(c)
0 4 1
IDL> print, c
3.56700
IDL> reads, format = '(e11.4)', b, c
IDL> print, size(c)
0 4 1
IDL> print, c
3.56700
IDL> c = ''
IDL> reads, format = '(e11.4)', a, c
IDL> print, size(c)
0 7 1
IDL> print, c
3.5670000
IDL> reads, format = '(e11.4)', b, c
IDL> print, size(c)
0 7 1
IDL> print, c
3.5670000


The print command works as expected when given a format, but when reads is
used, the variable "c", afraid of being labelled as an e-type by his f-type
friends, refuses, with all his strength, to be cast into e-notation. Why?

Charles
--
Charles Cavanaugh | "Words are very unnecessary, they can only do harm"
cavanaug@ncar.ucar.edu | - Depeche Mode
NCAR Boulder, CO, USA | "Facts all come with points of view"
My opinions | - Talking Heads
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: RE: Widget convulsions
Next Topic: Alternatives to IDL?

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

Current Time: Wed Oct 08 17:35:30 PDT 2025

Total time taken to generate the page: 0.00556 seconds