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

Home » Public Forums » archive » Re: Unsigned Integer Math Problem
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: Unsigned Integer Math Problem [message #70528 is a reply to message #70527] Wed, 21 April 2010 07:46 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig Markwardt writes:

> Hi David, I think there is no way to do exactly what you want. But
> this is a "doctor it hurts when I do this" problem. For plotting
> purposes, there is absolutely no harm in upcasting to a signed
> integer, and *then* doing your devious arithmetic.
>
> For that matter, why even bother with integers? For plotting
> purposes, make your calculations in double precision!

Well, as I just discovered in another program where this
same thing occurs, this is exactly what I do. :-(

I brought this up mostly as a cautionary tale about
doing math with unsigned integers. This is the second
time in a week unsigned integers have given me
heartburn.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: contour of 2D data
Next Topic: Re: Arc of a circle

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

Current Time: Wed Oct 08 17:09:58 PDT 2025

Total time taken to generate the page: 0.00601 seconds