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

Home » Public Forums » archive » Re: BYTES to LONG
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: BYTES to LONG [message #22335 is a reply to message #22334] Tue, 07 November 2000 00:00 Go to previous messageGo to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
"J.D. Smith" wrote:
>
> Paul van Delst wrote:
>>
>> For some reason the TOTAL returned a floating point number? Weird. Never noticed that
>> before.
>>
>
> The total() function always converts to floating point before the sum,
> to avoid overflow issues. Consider:
>
> a=total(bindgen(256))
>
> if it did the total as bytes, that would overflow. Of course, it could
> have done them as regular ints, but how should it decide, a priori? I
> for one use total a lot in testing various conditions, and it always
> bothered me that I had to test the floating result, but there's really
> no other clean solution.

You're absolutely right, of course. I've spent the last month writing a crapload of f90
code so when I saw a type that isn't what I thought I had declared it, I momentarily
freaked.


--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.207, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Electrical Engineer/Controls Specialist Wanted
Next Topic: Re: UTM conversion

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

Current Time: Sat Oct 11 06:25:47 PDT 2025

Total time taken to generate the page: 0.24029 seconds