Subject: Re: Setting wording for bit manipulation for non-binary hardware
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2021-03-07 03:17:14
On 3/7/21 2:57 AM, Vishal Oza via Std-Discussion wrote:
> The base of this idea is to add an undefined behavior clauseÂ if one
> writes C++ using bit manipulation in a targetÂ machine that does not use
> binary arithmeticÂ in its arithmetic model. The bits value would
> represent a digit in the numbering system or a q-bit if the systemÂ is a
> quantum computing system. The best example I can think of is to have an
> arithmeticÂ unit that has base 10 as its numbering system. We still have
> types like int, long, short, long long,Â unsigned int, unsigned long,
> unsigned short, unsigned long long, float and double as well as value
> defined in cstdint but the uint8_t would have value that range from 0 to
> 99999999 while on normal hardwareÂ it would range from 0 to 255.
The (u)intN_t types would have to be not defined, as these types are
required to use binary representation, and intN_t are also required to
use two's complement representation. Which is not applicable to your case.
> would be useful regardless of base as it would describe how the
> processor deals with multi-lengthÂ words. I am not sure if bit-shifting
> should be defined or not but if it is then the bit shift sure work with
> the hardware base and not assume base-2.
STD-DISCUSSION list run by email@example.com
Older Archives on Google Groups