[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] AVR-GCC question
From: |
Jeff Epler |
Subject: |
Re: [avr-gcc-list] AVR-GCC question |
Date: |
Mon, 23 May 2005 16:06:52 -0500 |
User-agent: |
Mutt/1.5.9i |
On Mon, May 23, 2005 at 04:47:08PM -0400, Dave Hansen wrote:
> [...]
> >-----Original Message-----
> >From: Jeff Epler [mailto:address@hidden
> [...]
> >#include <limits.h>
> >#define MAX_SIGNED(x) (double)((1ull<<(CHAR_BIT * sizeof(x) - 1))-1)
> >
> >Using this macro, though, the signed char -128 goes to a value below
> >-1.0. I think that's the same thing your code did.
>
> ?
>
> If x is a signed char, then sizeof(x) == 1. Always. Regardless of the
> value of x.
If CHAR_BIT == 8, then MAX_SIGNED(char) == 127.0, but -128/127 is -1.008...
Jeff
pgpiWaEH94twh.pgp
Description: PGP signature
- Re: [avr-gcc-list] AVR-GCC question, (continued)
- Re: [avr-gcc-list] AVR-GCC question, Daniel O'Connor, 2005/05/23
- Re: [avr-gcc-list] AVR-GCC question, E. Weddington, 2005/05/23
- Re: [avr-gcc-list] AVR-GCC question, Joerg Wunsch, 2005/05/23
- RE: [avr-gcc-list] AVR-GCC question, Trampas, 2005/05/23
- Re: [avr-gcc-list] AVR-GCC question, E. Weddington, 2005/05/23
- Re: [avr-gcc-list] AVR-GCC question, Matthew MacClary, 2005/05/23
- Re: [avr-gcc-list] AVR-GCC question, Joerg Wunsch, 2005/05/24
- Re: [avr-gcc-list] AVR-GCC question, Jeff Epler, 2005/05/23
- RE: [avr-gcc-list] AVR-GCC question, Trampas, 2005/05/23
- RE: [avr-gcc-list] AVR-GCC question, Dave Hansen, 2005/05/23
- Re: [avr-gcc-list] AVR-GCC question,
Jeff Epler <=
- Re: [avr-gcc-list] AVR-GCC question, Russell Shaw, 2005/05/23
- Re: [avr-gcc-list] AVR-GCC question, Daniel O'Connor, 2005/05/23
RE: [avr-gcc-list] AVR-GCC question, Matt.VanDeWerken, 2005/05/22
[avr-gcc-list] AVR-GCC question, Haase Bjoern (PT-BEU/EMT) *, 2005/05/23
Re: [avr-gcc-list] AVR-GCC question, Klaus Rudolph, 2005/05/23