Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: two's complement idea Date: Sat, 09 Nov 2019 05:55:28 -0800 Organization: A noiseless patient Spider Lines: 22 Message-ID: <86tv7dcfxr.fsf@linuxsc.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="bd07fdb0e7610947dc98257bdadc7724"; logging-data="9605"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j3PExBwROyBfSN43fY2wqkIB2XSPA6ow=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:D4hbi4ybnOxL9rWzR1xJ8n5WbhY= sha1:ObVaBki6gThzWr+/dFzVmgRh7IU= Xref: csiph.com comp.lang.c++:69677 "Alf P. Steinbach" writes: > On 05.11.2019 03:55, Siri Cruise wrote: > >> In article , >> Bonita Montero wrote: >> >>> What would realls speak against that numieric_limits would include >>> a flag whether a type has a two's complement and maybe another flag that >>> says that a type has a two's complement wrap-around? >> >> #define ONESCOMPLEMENT (-1==~1) >> #define TWOSCOMPLEMENT (-1==~0) > > Nice idea. > > But please use `constexpr` or `const` declarations, not macros. > > Using macros conveys the idea that macros are a reasonable solution to > the problem of naming a compile time constant. Why do C++ fans hate the C preprocessor so much?