avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Problem with signed 32bit ints?


From: Mike Panetta
Subject: Re: [avr-gcc-list] Problem with signed 32bit ints?
Date: 29 Jan 2003 10:39:35 -0500

Well, I do not believe its a truncation issue here because I am dealing
with numbers that will all fit in 16bits (at the moment, the reason for
wanting to change from 16 to 32bits is because I want to change some
values that will result in the output of the function generating values
that will no longer fit in 16bits).  

The main example is, I change just one of the 3 values from a 16 to a
32bit number (lets say Td for now), it works fine as a 16 bit number, I
do not get any overflow problems or anything, then I change it to a
32bit number, and when the result becomes less then 0 (any negative
number causes the problem) then the function starts acting like it
output a really large positive number instead.  I am not sure why this
is happening, but when it does, it causes all sorts of problems.  I am
going to see if I can write a test case here in a minute that I can send
to the list...  Does this list accept attachments?  (I am on the list
now BTW).


Mike

On Wed, 2003-01-29 at 08:17, TODD BATZLER wrote:
> Have you eliminated the issue with letting the compiler determine how to
> truncate
> the results of your multiplications by using smaller data types to
> test, or checking 
> what happens when your 32x8 multiply results in a value greater than 16
> bits?
> 
> Your reference to "fails to work" is a little vague.   Can you provide
> more detail?
> 
> Todd Batzler
> Senior Staff Engineer
> Miller Electric Mfg Co
> 1635 W Spencer St
> Appleton, WI 54914-0000 USA
> Phone:  920 735 4230
> Fax:  920 735-4488
> email:  address@hidden
> 


avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]