Mixing operations with signed and unsigned types

"Jérôme M. Berger" jeberger at free.fr
Thu Jul 8 10:43:04 PDT 2010


Stewart Gordon wrote:
> Ellery Newcomer wrote:
>> On 07/06/2010 07:05 PM, Stewart Gordon wrote:
> <snip>
>>> Just using uint, of course!
>>
>> For enforcing a non-negative constraint, that is brain damaged.
>> Semantically, the two are very different.
> 
> So effectively, the edit wars would be between people thinking at cross
> purposes.
> 
> I guess it would be interesting to see how many libraries are using
> unsigned types wherever the value is semantically unsigned, and how many
> are using signed types for such values (maybe with a few exceptions when
> there's a specific reason).
> 
	I used to use unsigned types wherever the value is semantically
unsigned, but I am in the process of changing to signed everywhere
possible because of the brain dead way mixed operations are handled
(in C, but D would be the same).

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20100708/b6a88ebe/attachment.pgp>


More information about the Digitalmars-d-learn mailing list