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

Home » Public Forums » archive » Re: Basic Math: I _hope_ this is a stupid question
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: Basic Math: I _hope_ this is a stupid question [message #43754 is a reply to message #43752] Wed, 27 April 2005 09:26 Go to previous messageGo to previous message
Geoff Cureton is currently offline  Geoff Cureton
Messages: 4
Registered: May 2000
Junior Member
Ed Hyer wrote:

> IDL> print,288*180
> -13696
> IDL> print,long(288*180)
> -13696
> IDL> print,ulong64(288*180)
> 18446744073709537920
> IDL> print,288.*180
> 51840.0
>
> I just want to multiply two integers! Is that so wrong?

What about appending "L" to the integers to make sure they are of type
long integer. Thus...

IDL> print,288L*180L
51840

Like someone wrote, your ints must be cast as long int *before* the
computation, so it is done with long int arithmetic. Trying to cast
the result as long int afterwards won't work, the damage is done :-)

Hope this helps,
Geoff
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLgrPolygon -TEXTURE_MAP question
Next Topic: overriding system functions.

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

Current Time: Sun Oct 12 04:18:52 PDT 2025

Total time taken to generate the page: 1.11556 seconds