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

Home » Public Forums » archive » Re: Print, 34000/340000 results 0? what ́s wrong?
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
Re: Print, 34000/340000 results 0? what ́s wrong? [message #38917] Mon, 05 April 2004 07:57
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Thomas Nehls wrote:
>
> Hi folks,
>
> I tried to calculate something and found out that something must be
> wrong... I also tried Float and so on...

Nothing's wrong; according to the rules for integer arithmetic,
34000/340000 is 0, so it printed out exactly the correct result. If you
divided 34000.0/340000, then it should give you a 0.1. But you said that
you tried Float, and it didn't work? Perhaps you tried one of the
following:

PRINT,FLOAT(34000/340000)
PRINT,FORMAT="(F)",34000/340000

Neither of those would give you what you want. The division occurs
first, producing a 0, which is then converted to floating point. On the
other hand:

PRINT,FLOAT(34000)/340000

should do precisely what you want.
Re: Print, 34000/340000 results 0? what ́s wrong? [message #38922 is a reply to message #38917] Mon, 05 April 2004 05:28 Go to previous message
marcuirl is currently offline  marcuirl
Messages: 14
Registered: December 2003
Junior Member
Thomas Nehls <thomas.nehls@tu-berlin.de> writes:

> Hi folks,
>
> I tried to calculate something and found out that something must be
> wrong... I also tried Float and so on...
> Where is my mistake?

34000/340000.
^^^
Try that!

marcu

--
Unless otherwise noted, the statements herein reflect my
personal opinions and not those of any organisation with
which I may be affiliated.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Keyword abbreviation ambiguities
Next Topic: Re: 8 bit color

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

Current Time: Fri Oct 10 13:39:57 PDT 2025

Total time taken to generate the page: 0.31684 seconds