#combinator bitshift complaining
1 messages · Page 1 of 1 (latest)
I cannot be hidden!
youve fallen into my trap
probably should be renamed to "combinator bitshift complaining"
or "combinator bitshift schenanigannery"
"tomfoolery"
combinator bitshift complaining
(In fact the bit shift defined on integers is not one but multiple different groups)
what's wrong with computer scientists
couldn't they just define something and make that thing a thing
(but there's 20 different ways to answer it with varying pros and cons)
which one has the O(1) memory complexity, I'll take it
They all do.
THAT'S THE PROBLEM.
Basic bit shifting exists pretty much exclusively for serial communication. You're just... moving bits through a register and reading off the last one.
new mod idea: nasal demons
shifting by less than 0 or at least 32 places causes your combinator to explode because of the undefined behavior
Arithmetic bit shifting exists because -2 >> 1 should be -(2 >> 1) and under 2c that means the highest order bit needs to be preserved.
Carry shift exists because sometimes you're working with bigger numbers so you need to carry in from the next byte up.
Cycle shifting exists because otherwise you need two instructions, one to grab the lowest order bit, and one to carry-in shift everything else.
What's interesting.
Is that the result of (1 << -1) << 1 is undefined.
@deep summit if it was always arithmetic bitshifting, 1 << 31 would be 0, not 1 - 2 ^ 32.
damn you kovarex
Yeah that too. Arithmetic bit shifts preserve the highest bit.
This is a cycle, methinks.
1 << 32 = 1
But 1 >> 32 also = 1
Honestly, my Kovarex solution is just to not output 238 unless there's more than enough for two or three reactors in a chest already.
I tried doing the counter thing.
I really did.
you're pulling my leg right
I am not.
kovarex is the head dev of factorio
Oh.
that's why it's called kovarex enrichment
is ignorant to these things.
that's alright
My usual operating mode is, see game, play game, neuron activation, happy chemicals.
But yeah I encountered the bitshift fuckery earlier today with my prior posting.
Was trying to work out how to make a digital display that only showed necessary digits.
Next challenge: negatives.
have fun
This is a classic programmer argument. Complain about undefined behavior, while specifying that your specific undefined behavior is correct. I literally just did the same thing regarding markdown parsers. in #programming chat.
Honestly, I wish we had the logarithm combinator.
I just realized.
We can make alphabetic or numeric displays.
But we can't make an alphanumeric one because that needs at least 36 bits to encode.
use an encoding flag?
I guess, but at its logical extreme it becomes purely a mapping.
Hol' up a moment.
Alright so, theory.
Combinator for each segment.
Wait, no, hold on.
All the possible combinations for a 7-segment can be encoded within 7 bits.
If we want to go into logical extremes we can have a decoder unit that dumps combinations onto a bus, which each individual digit consumes.
In theory we can abuse the rather large number of symbols available to make a grid sort of deal.
In layman's terms, 2^32 possible input values, 2^(whatever the number of distinct symbols there are) choices from those input values.