Re: unsigned long long + int
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 09/29/04
- Next message: Gordon Burditt: "Re: attempt at qsort implementation"
- Previous message: Abhinav: "Re: elementary construction +2"
- In reply to: Peter Ammon: "Re: unsigned long long + int"
- Next in thread: S.Tobias: "Re: unsigned long long + int"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Sep 2004 05:56:35 GMT
Peter Ammon wrote:
> Mike Wahler wrote:
>> "Peter Ammon" <peter_ammon@rocketmail.com> wrote in message
>>
>>> When I add an unsigned long long and an int, what type do each
>>> of the values get promoted to before the addition is performed?
>>
>> The 'unsigned long long' object is not promoted at all.
>> The 'int' object is promoted to 'unsigned long long'.
>
> Thanks! How does this promotion occur? Is it guaranteed to
> convert the value modulo ULLONG_MAX + 1 (like I hope), or is it
> an implementation defined thing?
Yes, guaranteed.
-- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
- Next message: Gordon Burditt: "Re: attempt at qsort implementation"
- Previous message: Abhinav: "Re: elementary construction +2"
- In reply to: Peter Ammon: "Re: unsigned long long + int"
- Next in thread: S.Tobias: "Re: unsigned long long + int"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|