weilewei has quit [Remote host closed the connection]
hkaiser has joined #ste||ar
nikunj has quit [Read error: Connection reset by peer]
nikunj has joined #ste||ar
nikunj has quit [Ping timeout: 246 seconds]
nikunj has joined #ste||ar
<jbjnr>
is my connection broken, or is nobody posting anything today?
<Yorlik>
jbjnr: quack ;)
<zao>
Simberg said something about the Docker env, otherwise nada.
<jbjnr>
ok. Thanks - I see new messages. My riot window was stuck again and I reconnected.
diehlpk_work has joined #ste||ar
akheir has joined #ste||ar
weilewei has joined #ste||ar
bita_ has joined #ste||ar
<weilewei>
if I have a = (int) b * (uint64_t) c, will variable a becomes uint64_t automatically? Does it mean that lower rank type operation higher rank type guarantee to have a result of higher rank type?
<K-ballo>
the variable won't change type.. is it an `auto a = ...;` kind of situation?
<weilewei>
yes
<Yorlik>
int can be negative, uint64_t not ...
<Yorlik>
Interesting conflict
<K-ballo>
the int argument will be promoted to uint64_t
<Yorlik>
So - if it is -1 it will be 0xFFF...?
<weilewei>
I see, thanks! K-ballo
<weilewei>
Yorlik if b is negative, I doubt that promotion will be undefined value
<K-ballo>
it is defined, used to be implementation-defined, now we have 2's complement so it would indeed be 0xffff...
<Yorlik>
I wonder where there are type promotion rules written to look up. With the given example and statements bit width wins over signum.
<K-ballo>
in modulo arithmetics -1 == 2^n -1
<weilewei>
same question, where to read up this knowledge?
<Yorlik>
Is that equivalent with 2-complement? I just recently heared that term "modulo arithmetics" for the first time, though I've been knowing % for ages already.
<K-ballo>
weilewei: I'd recommend not knowing any of this
<K-ballo>
the next guy coming up (maybe you in a few months) will be wondering what type `a` has
<K-ballo>
modulo arithmetic is not equivalent to 2's complement
<weilewei>
lol, really, but I really want to get my mind straight, I am dealing with large index which requires uint64_t, so I am trying to avoid type issues
<weilewei>
in `Integral conversions` section, it mentions about modulo arithmetic. The wording takes sometime to understand.. I will read it up
<K-ballo>
it just means you take the module 2^n of the result (which is dropping higher bits)
<weilewei>
K-ballo got it! thanks
<Yorlik>
So x%(2^n) is basicvally a nice bit truncator, like and according bitwise and would be
<K-ballo>
x%(2^n) === x & (2^n - 1) which is a mask with the first n bits on
<Yorlik>
I wonder if there are some good resources out for bit arithmetic and all the things you can do with it. I recently had to do stuff with intrinsics and bit manibulations and realized my knowledge in that domain is horribly underdeveloped.
rtohid has joined #ste||ar
nan11 has quit [Remote host closed the connection]