A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-December/094400.html below:

[Python-Dev] Drop support for ones' complement machines?

[Python-Dev] Drop support for ones' complement machines? [Python-Dev] Drop support for ones' complement machines?Mark Dickinson dickinsm at gmail.com
Tue Dec 1 18:25:04 CET 2009
On Tue, Dec 1, 2009 at 5:22 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
> or a workaround.  E.g., for an unsigned long x,
>
>  ((x) >= 0 ? (long)(x) : ~(long)~(x))
>
> always gives the appropriate wraparound semantics (I think), assuming

Sorry;  should have tested.  Try:

((x) <= LONG_MAX ? (long)(x) : ~(long)~(x))

Mark
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4