#Ternary Operator
Explore tagged Tumblr posts
gagande · 8 months ago
Text
Tumblr media
Ternary Operator Mastery | Purecode
Moving on, we’ll discuss the ternary operator, a powerful tool for writing more concise conditional logic. It’s like an if-else statement, but shorter, quicker, and just as effective.
0 notes
wereblossoms · 2 years ago
Text
Tumblr media
gdscript is fun
44 notes · View notes
piratesexmachine420 · 2 months ago
Text
Motorola should hire me to make a 68 Million CPU
5 notes · View notes
removeload-academy · 2 months ago
Text
youtube
C++ Ternary Operator in Hindi | What is Ternary Operator | C++ Tutorials
The ternary operator in C++ is a concise way to perform conditional expressions. It's a shorthand for an if-else statement, where the result depends on a condition. For more details, Kindly check my website URL: https://www.removeload.com/cpp-operators
0 notes
trendingnow3-blog · 2 years ago
Text
Day-3: Mastering Control Flow and Logical Operators in Python
Python Boot Camp - 2023
Python is a versatile and widely used programming language known for its simplicity and readability. One of the fundamental aspects of programming is controlling the flow of execution based on certain conditions. Python provides various control flow statements and logical operators that allow programmers to make decisions and perform actions accordingly. 1. Introduction to Control Flow in…
Tumblr media
View On WordPress
0 notes
phantomrose96 · 1 year ago
Note
It's occurred to my feldspar brain that this is maybe not readable to everyone.
It means if you have given less than 30 boops, your meter has the color with a gradient from #A9B1BD" to "#62676F" (<=hex colors). Once you have given 30 or more boops (but less than 100), it gets the next gradient which is "#00B8FF" to "#FF61CE".
So on so forth at 300, 700, and 998.
the color of the meter changes for boops given too! once you reach 100 it turns to a red to purple gradient. I think 30 is the pink to blue gradient threshold
I noticed this!
Not because I got that far, but because I found it in the code lol lmao
Tumblr media
These are the gradients and counts have fun.
text beneath the readmore if anyone cares about being able to copy/paste
function T(e) { return e <= 30 ? { start: "#A9B1BD", end: "#62676F" } : e <= 100 ? { start: "#00B8FF", end: "#FF61CE" } : e <= 300 ? { start: "#7C5CFF", end: "#FF4930" } : e <= 700 ? { start: "#01CF35", end: "#7C5CFF" } : e <= 998 ? { start: "#FF4930", end: "#FF8A00" } : { start: "#FF61CE", end: "#7C5CFF" } }
157 notes · View notes
talonabraxas · 3 months ago
Text
Tumblr media Tumblr media Tumblr media
“When we love, we see the infinite in the finite. We find the Creator in the creation.” — Éliphas Lévi
Astral Merkabah Talon Abraxas Eliphas Levi: Imagination and the Microcosm-Macrocosm All forms correspond to ideas, and there is no idea which does not have its proper and peculiar form. The primordial light (which is the vehicle of all ideas) is the mother of all forms and transmits them from emanation to emanation (becoming diminished or altered according to the density of the medium). Secondary forms are the reflections which return to the home (or hearth) of the emanated light. Forms of objects (being a modification of the light) remain in the light whereas the reflection expels them. Thus the astral light, or the terrestrial fluid (which we call the great magical agent) is saturated with images or reflections of all types. Our soul can evoke and submit these images or reflections to its imagination (which is what the Kabbalists call the diaphane). These images are always present to us and are only erased by more powerful imprints of reality during waking hours, or by the preoccupation of the mind (which makes our imagination inattentive to the moveable panorama of the astral light). The world is magnetized by the light of the sun, and we are magnetized by the astral light of the world. That which operates in the body of the planet, is repeated in us. There are three analogical and hierarchic worlds within us, as there are in all of nature. Man is the microcosm or little world and according to the dogma of analogies: everything that is in the big world is reproduced in the little world. There are therefore three centers of fluidic attraction and projection in us: the brain, the heart or epigastrum, and the genital organ. Each of these organs is one and double, that is to say, we find the idea of the ternary therein. Each of these organs attracts in one way and repels in another. It is by means of these apparatuses that we place ourselves in communication with the universal fluid, transmitted in us through the nervous system. It is also these three centers which are the seat of a triple magnetic operation.
33 notes · View notes
lilith-hazel-mathematics · 2 months ago
Text
Self-referencing functions
Hey mathblr, let me tell you about one of our favorite foundational systems for mathematics! It's designed to allow for unlimited self-reference, which is neat since self-reference is usually thought of as a big no-no in foundational systems. It turns out that it actually doesn't matter at all, because the power of self-reference is completely exhausted by the partial computable functions. The theory ends up being equivalent to Peano Arithmetic.
What are the axioms?
The theory is two-typed: the first type is for the natural numbers, and the second type is for functions between numbers. For convenience, numbers will be represented by lowercase variables, and uppercase variables represent functions. To prevent logical contradictions, we permit that some functions will fail to evaluate, so we include a non-number object ☒ called "null" for such cases. The axioms about numbers are basically what you'd expect, and we only need one axiom about functions.
The < relation is a strict total order between numbers.
Each nonempty class has a minimum: axiomatize the "min" operator with φ(n) ⇒ ∃m,(φ(m) ∧ min{k:φ(k)}=m≤n) for each predicate φ, and relatedly min{k:φ(k)}=☒ ⇔ ∀n, ¬φ(n).
Numbers exist: ∃n,n=n
There's no largest number: ∀n,∃k,n
There's no infinite number: ∀n,n=0 ∨ ∃k,n=S(k)
Every functional expression represents a function object that exists: ∃F, ∀(a,b,c), F(a,b,c)=Ψ for any function term Ψ. The term Ψ may mention F.
To clarify the fifth axiom, we define 0:=min{n : n=n}, and relatedly S(k):=min{n : k<n} is the successor function. The sixth axiom allows us to construct self-referencing functions using any "function term". Basically, a term is any expression which evaluates numerically. Formally, a "function term" is any well-formed formula generated from the following formation rules.
"n" is a term; any number variable.
"F(Θ,Φ,Ψ)" is a term, whenever Θ,Φ,Ψ are terms.
"Φ<Ψ" is a term, whenever Φ,Ψ are terms.
"min{n : Ψ}" is a term, whenever Ψ is a term.
In the third rule, we seem to be using the boolean relation < as if it were a numerical operator. To clarify this, we use the programmer convention that true=1 and false=0, hence (n<k)=1 whenever n<k is true, and otherwise it's zero. Similarly in the fourth rule, when we use the numerical function term Ψ as the argument to the "min" operator, we interpret Ψ as being false whenever it's 0, and true whenever it's positive. Formally, we can use the following definitions.
(n<k) = min{b : k=0 ∨ ((n<k ⇔ b=1) ∧ n≠☒≠k)} min{n : Ψ(n)} = min{n : 0<Ψ(n) ∧ ∀(k<n),Ψ(k)=0}
Okay, what can it do?
The formation rules on functions actually gives us a TON of versatility. For example, the "<" relation can be used to encode literally all boolean logic. Here's how you might do that.
¬x = (x<1) (x≤y) = ¬(y<x) x⇒y = (¬¬x ≤ ¬¬y) x∨y = (¬x ⇒ y) x∧y = ¬(¬x ∨ ¬y) (x=y) = ((x≤y)∧(y≤x)) [p?x:y] = min{z : (p∧(z=x))∨(¬p∧(z=y))}
That last one is the ternary conditional operator, which can be used to implement casewise definitions. If you wanna get really creative, you can implement bounded quantification as an operator, which can then be used to define the supremum/maximum operator!
∃[t<x, F(t)] = (min{t : t=x ∨ ¬F(t)}<x) ∀[t<x, F(t)] = ¬∃[t<x, ¬F(t)] sup{F(t) : t<x} = min{y : ∀[t<x, F(t)≤y]}
Of course, none of this is even taking advantage of the self-reference that our rules permit. For example, we could implement addition and multiplication using their recursive definitions, provided we define the predecessor operation first. Alternatively, we can use the supremum operator as a little shortcut.
x+y = [y ? sup{succ(x+t) : t<y} : x] x*y = sup{(x*t)+x : t<x} x^y = [y ? sup{(x^t)*x : t<y} : 1]
Using the axioms we established, basically as a simple induction, it can be proved that these operations are total and obey their ordinary recursive definitions. So, our theory is at least as strong as Peano Arithmetic. It's not hard to believe that our functions can represent any partial computable function, and it's only a little harder to prove it formally. Conversely, all our axioms are true when restricted to the domain of partial computable functions, so it's consistent that all our functions are computable. In particular, there's a straightforward way to interpret each function term as a computer program. Since PA can quantify over computable functions, our theory is exactly as strong as PA. In fact, it's basically just a definitorial extension of PA. Pretty neat, right?
Set theory jumpscare
Hey didn't you think it was weird how we never asserted the axiom of induction? We asserted wellfoundedness with the minimization operator, which is basically equivalent, but we also had to deny infinite numbers for induction to work. What if we didn't do that? What if we did the opposite? Axiom of finity unfriended, our domain of discourse is now the ordinal numbers. New axioms just dropped.
There's an infinite number: ∃w, 0≠w ∧ ∀k, S(k)≠w
Supremums: (∀(x≤a),∃y,φ(x,y)) ⇒ ∃b,∀(x≤a),∃(y≤b),φ(x,y)
Unlimited Cardinals: ∀a, ∃b, #(a)<#(b), where #(n) denotes the cardinality operation.
Each of the above axioms basically just assert the existence of larger and larger ordinal numbers, continuing the pattern set out by the third and fourth axioms from before. Similar to how the previous theory could represent all computable functions, this theory can represent all the ordinal recursive functions. These are the functions which are representable using an Ordinal Turing Machine (OTM). Conversely, it's consistent that all functions are ordinal recursive, since each function term can be interpreted as a program that's executable by an OTM. Moreover, just like how the previous theory was exactly as strong as PA, this theory is exactly as strong as ZFC.
It takes a lot of work to interpret ZFC, but basically, a set can be represented by its wellfounded and extensional membership graph. The membership graphs can, in turn, be encoded by our ordinal recursive functions. Using the Supremums axiom, it can be shown that the resulting universe of sets obeys a version of the Axiom of Replacement, which can be used to prove the Reflection Theorems, ultimately leading to the Specification Axiom. By adapting similar techniques relative to some regular cardinal, it can then be shown that every set admits a powerset. Lastly, since our functions are basically generated from infinitary computer code, they can be encoded by finite strings having ordinal numbers as symbols. Those finite strings are wellorderable, which induces a global choice function, proving the Axiom of Choice. Excluding a few loose ends, this covers all the ZFC axioms, giving the desired interpretation.
In the finitistic version of this theory, we made the observation that the theory was basically just a definitorial expansion of PA. In the infinitary case however, we unfortunately cannot say the same about ZFC. This ultimately comes down to the fact that our theory provides explicit and definable choice functions, meanwhile ZFC cannot. Although ZFC guarantees that choice functions exist, it cannot prove the existence of a definable choice function. This is because ZFC is an inferior theory has no clue where its sets come from, or what they really look like. Our theory, built from unlimited self-reference, and interpreted under the banner of ordinal recursive functions, is instead equivalent to the theory ZFC+"V=L".
52 notes · View notes
bubbloquacious · 7 months ago
Text
Algebraic structure you could consider: the uneven integers under the ternary operation of adding three numbers together
48 notes · View notes
definitely-zen-browser · 23 days ago
Text
Ternary operator… save me ternary operator
8 notes · View notes
gagande · 7 months ago
Text
purecode ai company reviews | Conditional Rendering
Conditional rendering in JSX allows you to render components or elements based on specific conditions. This can be achieved using JavaScript logical operators like && (logical AND) or the ternary operator ? : for more concise expressions
0 notes
kremlin · 2 years ago
Note
How DOES the C preprocessor create two generations of completely asinine programmers??
oh man hahah oh maaan. ok, this won't be very approachable.
i don't recall what point i was trying to make with the whole "two generations" part but ill take this opportunity to justifiably hate on the preprocessor, holy fuck the amount of damage it has caused on software is immeasurable, if you ever thought computer programmers were smart people on principle...
the cpp:
Tumblr media Tumblr media Tumblr media
there are like forty preprocessor directives, and they all inject a truly mind-boggling amount of vicious design problems and have done so for longer than ive been alive. there really only ever needed to be one: #include , if only to save you the trouble of manually having to copy header files in full & paste them at the top of your code. and christ almighty, we couldn't even get that right. C (c89) has way, waaaay fewer keywords than any other language. theres like 30, and half of those aren't ever used, have no meaning or impact in the 21st century (shit like "register" and "auto"). and C programmers still fail to understand all of them properly, specifically "static" (used in a global context) which marks some symbol as inelligible to be touched externally (e.g. you can't use "extern" to access it). the whole fucking point of static is to make #include'd headers rational, to have a clear seperation between external, intended-to-be-accessed API symbols, and internal, opaque shit. nobody bothers. it's all there, out in the open, if you #include something, you get all of it, and brother, this is only the beginning, you also get all of its preprocessor garbage.
this is where the hell begins:
#if #else
hey, do these look familiar? we already fucking have if/else. do you know what is hard to understand? perfectly minimally written if/else logic, in long functions. do you know what is nearly impossible to understand? poorly written if/else rats nests (which is what you find 99% of the time). do you know what is completely impossible to understand? that same poorly-written procedural if/else rat's nest code that itself is is subject to another higher-order if/else logic.
it's important to remember that the cpp is a glorified search/replace. in all it's terrifying glory it fucking looks to be turing complete, hell, im sure the C++ preprocessor is turing complete, the irony of this shouldn't be lost on you. if you have some long if/else logic you're trying to understand, that itself is is subject to cpp #if/#else, the logical step would be to run the cpp and get the output pure C and work from there, do you know how to do that? you open the gcc or llvm/clang man page, and your tty session's mem usage quadruples. great job idiot. trying figuring out how to do that in the following eight thousand pages. and even if you do, you're going to be running the #includes, and your output "pure C" file (bereft of cpp logic) is going to be like 40k lines. lol.
the worst is yet to come:
#define #ifdef #ifndef (<- WTF) #undef you can define shit. you can define "anything". you can pick a name, whatever, and you can "define it". full stop. "#define foo". or, you can give it a value: "#define foo 1". and of course, you can define it as a function: "#define foo(x) return x". wow. xzibit would be proud. you dog, we heard you wanted to kill yourself, so we put a programming language in your programming language.
the function-defines are pretty lol purely in concept. when you find them in the wild, they will always look something like this:
#define foo(x,y) \ (((x << y)) * (x))
i've seen up to seven parens in a row. why? because since cpp is, again, just a fucking find&replace, you never think about operator precedence and that leads to hilarious antipaterns like the classic
#define min(x,y) a < b ? a : b
which will just stick "a < b ? a: b" ternary statement wherever min(.. is used. just raw text replacement. it never works. you always get bitten by operator precedence.
the absolute worst is just the bare defines:
#define NO_ASN1 #define POSIX_SUPPORTED #define NO_POSIX
etc. etc. how could this be worse? first of all, what the fuck are any of these things. did they exist before? they do now. what are they defined as? probably just "1" internally, but that isn't the point, the philosophy here is the problem. back in reality, in C, you can't just do something like "x = 0;" out of nowhere, because you've never declared x. you've never given it a type. similar, you can't read its value, you'll get a similar compiler error. but cpp macros just suddenly exist, until they suddenly don't. ifdef? ifndef? (if not defined). no matter what, every permutation of these will have a "valid answer" and will run without problem. let me demonstrate how this fucks things up.
do you remember "heartbleed" ? the "big" openssl vulnerability ? probably about a decade ago now. i'm choosing this one specifically, since, for some reason, it was the first in an annoying trend for vulns to be given catchy nicknames, slick websites, logos, cable news coverage, etc. even though it was only a moderate vulnerability in the grand scheme of things...
(holy shit, libssl has had huge numbers of remote root vulns in the past, which is way fucking worse, heartbleed only gave you a random sampling of a tiny bit of internal memory, only after heavy ticking -- and nowadays, god, some of the chinese bluetooth shit would make your eyeballs explode if you saw it; a popular bt RF PHY chip can be hijacked and somehow made to rewrite some uefi ROMs and even, i think, the microcode on some intel chips)
anyways, heartbleed, yeah, so it's a great example since you could blame it two-fold on the cpp. it involved a generic bounds-checking failure, buf underflow, standard shit, but that wasn't due to carelessness (don't get me wrong, libssl is some of the worst code in existence) but because the flawed cpp logic resulted in code that:
A.) was de-facto worthless in definition B.) a combination of code supporting ancient crap. i'm older than most of you, and heartbleed happened early in my undergrad. the related legacy support code in question hadn't been relevant since clinton was in office.
to summarize, it had to do with DTLS heartbeats. DTLS involves handling TLS (or SSLv3, as it was then, in the 90s) only over UDP. that is how old we're talking. and this code was compiled into libssl in the early 2010s -- when TLS had been the standard for a while. TLS (unlike SSLv3 & predecessors) runs over TCP only. having "DTLS heartbeat support in TLS does not make sense by definition. it is like drawing a triangle on a piece of paper whose angles don't add up to 180.
how the fuck did that happen? the preprocessor.
why the fuck was code from last century ending up compiled in? who else but!! the fucking preprocessor. some shit like:
#ifndef TCP_SUPPORT <some crap related to UDP heartbeats> #endif ... #ifndef NO_UDP_ONLY <some TCP specific crap> #endif
the header responsible for defining these macros wasn't included, so the answer to BOTH of these "if not defined" blocks is true! because they were never defined!! do you see?
you don't have to trust my worldview on this. have you ever tried to compile some code that uses autoconf/automake as a build system? do you know what every single person i've spoken to refers to these as? autohell, for automatic hell. autohell lives and dies on cpp macros, and you can see firsthand how well that works. almost all my C code has the following compile process:
"$ make". done. Makefile length: 20 lines.
the worst i've ever deviated was having a configure script (probably 40 lines) that had to be rune before make. what about autohell? jesus, these days most autohell-cursed code does all their shit in a huge meta-wrapper bash script (autogen.sh), but short of that, if you decode the forty fucking page INSTALL doc, you end up with:
$ automake (fails, some shit like "AUTOMAKE_1.13 or higher is required) $ autoconf (fails, some shit like "AUTOMCONF_1.12 or lower is required) $ aclocal (fails, ???) $ libtoolize (doesn't fail, but screws up the tree in a way that not even a `make clean` fixes $ ???????? (pull hair out, google) $ autoreconf -i (the magic word) $ ./configure (takes eighty minutes and generates GBs of intermediaries) $ make (runs in 2 seconds)
in conclusion: roflcopter
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ disclaimer | private policy | unsubscribe
159 notes · View notes
piratesexmachine420 · 9 months ago
Text
The theory of operation for my balanced ternary "shift register" is actually pretty simple, though it might not look like it -- once you spend some time in it, so to speak, it's totally grokable.
Ready? This is gonna be looong.
Okay.
First, in case anyone reading this is unaware of what a logic gate, truth table, or the balanced ternary number system is, you'll want to read these three Wikipedia articles to get some background knowledge:
https://en.wikipedia.org/wiki/Truth_table
https://en.wikipedia.org/wiki/Logic_gate
https://en.wikipedia.org/wiki/Balanced_ternary
Second, if you're unaware of how water and lava behave in Minecraft, you'll want to read this article from the Minecraft wiki.
Thirdly, you'll want to read these excerpts (↓) from my notes (my apologies for their quality), where I list my personal conventions and definitions for what is to come.
Tumblr media Tumblr media Tumblr media Tumblr media
Got that all?
What we want to do now is try to construct some of the aforementioned logic gates with Minecraft's fluid model. Water will be used to represent 1, lava will represent T (-1), and air (neither water nor lava) will represent 0.
Believe it or not, this isn't too difficult. Most of the logic gates I describe above are rather simple to implement -- so long as we ignore the timing constraints imparted by water and lava flowing at different rates, which for the sake of brevity (brevity, lol) we will.
Two of the most fundamental of these logic gates, at least for our purposes, are MAND and OR. They are implemented like this (↓)
Tumblr media Tumblr media
If you're having trouble grasping how these work, and have access to a copy of the game, I encourage you to play around with it yourself! After a while, the principles start to become pretty intuitive.
We can use these "fundamental" gates to construct the rest. ISN, ISP, NISN, and NISP can be made by simply hard-wiring one or the other of the inputs of a MAND gate to 1/water or T/lava. (Not that you'd always want to implement ISP in particular that way--it's actually the third fundamental logic gate and can be implemented via a different principle, but I digress)
From there we can construct NEG, as NEG a is equal to (NISN a) OR (NISP a); from NEG we can construct AND, because a AND b = a MAND (NEG b); and so on and so forth. (Exercise for the reader to derive the rest :P)
This brings us back to the shift register, which is primarily constructed of these (↓) little circuits who operate analogously to normally-closed relays.
Tumblr media
Let the green input be a, the white input be b, and the output be q. When a is nonnegative (0 or 1), b will "pass through", so to speak, and q = b. When a is negative (T), q will always be 0.
Put more simply, q = b OR (ISN a) OR (NISN a). Run the numbers and you'll see how it works!
From there, it's pretty trivial to line a few of these up, tie their outputs together, and get a demultiplexer -- a circuit that takes in some number of inputs (here three) and "selects" one of them to output. Let's look at our demultiplexer now:
Tumblr media
Let s1, s2 and s3 be the blue "selector" inputs; p1, p2, and p3 be the white "selectee" inputs; b1, b2 and b3 be the intermediate "blocking" signals (the green inputs from earlier); q1, q2 and q3 be the outputs from our relays; and q (no number) be the overall output.
The yellow and light blue circuitry are our relays, the black concrete is the aforementioned output tying-together (q = q1 OR q2 Or q3), and the blue and red circuitry is... complicated.
Its job, though, is simple: translate a positive "selecting" signal on one of its three inputs (s1, s2 and s3) into two negative "blocking" signals to be sent to the relays (b1, b2, b3).
This is implemented as follows:
b1 = (NISP (s1 OR s2 OR s3)) OR s1 b2 = (NISP (s1 OR s2 OR s3)) OR s2 b3 = (NISP (s1 OR s2 OR s3)) OR s3
In other words, b1 is negative iff s2 or s3 is positive, b2 is negative iff s1 or s3 is positive, and b3 is negative iff s1 or s2 is positive.
Let's work through an example. Say c1 is 1, c2 is 0 and c3 is T, and we set s3 to 1--"selecting" c3.
Since s1 and s2 are 0, and s3 is 1, s1 OR s2 OR s3 = 1 and NISP (s1 OR s2 OR s3) = T
It follows then that b1 = T OR s1 = T OR 0 = T, b2 = T OR s2 = T OR 0 = T, and b3 = T OR s3 = T OR 1 = 0.
Finally, since b1 and b2 are T, q1 and q2 are 0 (relay 1 and relay 2 "block" their inputs from flowing through) and since b3 is 0, q3 = p3 and thus q = q3 = p3 = T.
Got that? Great! Let's move on to the monster then.
Tumblr media
A diagram may be in order.
Tumblr media
Better?
The shift register (again not the correct term because this is a one-time use circuit, but I digress -- they're roughly analogous) is constructed mainly of demultiplexers (light blue boxes), as described before.
Each demuxer is selecting between the input directly above it, the input to its left, and the input to its right. (e.g. demuxer #4 is selecting between In3, In4 and In5).
The signals telling the demuxers which inputs to select (s1, s2 and s3 from earlier) are generated by the "split" box (in blue) from the "Selector" signal. If "Selector" is T, "Split" sends a positive signal to the s1 input of the demuxers; if it is 0, s2; if it is 1, s3.
This is implemented as follows:
s1 = NISN "Selector" s2 = NISN ("Sync" OR s1 OR s3) s3 = ISP "Selector"
The "Sync" signal line (in orange) and circuits (purple boxes) work to ensure the timing constraints and invariants we've so far elided are upheld. "Sync" is always either 0 (wait for sync) or T (resume), never 1.
The purple boxes work like the opposite of the relays we described earlier: they receive an input and only output it after they receive a "Sync" signal.
They are implemented as follows:
q = (a MAND "Sync") OR (a MAND (NISN "Sync"))
Likewise, the "Split" box waits for a "Sync" signal to determine if "Selector" is 0 -- if it "jumped the gun" it wouldn't be able to go back and correct its output, all fluid-based logic gates are necessarily one time use.
What does all of this nonsense accomplish?
When "Selector" is 0, the input is simply passed through; when "Selector" is T, the input is shifted left (Out1 = In2, Out2 = In3... Out6 = 0); when "Selector" is 1, the input is shifted right (Out1 = 0, Out2 = In1... Out6 = In5). This is equivalent to either multiplying or dividing the output by 3.
And that's that!
If you have any further questions, feel free to let me know! Hell, if you managed to read this whole thing, feel free to let me know! (I hope at least someone is able to...)
48 notes · View notes
removeload-academy · 3 months ago
Text
youtube
C Ternary Operator in Hindi | What is Ternary Operator in C | Example of Ternary Operator
The ternary operator in C is a conditional operator that provides a shorthand way of writing simple if-else statements. It takes three operands, hence the name "ternary." For more details, Kindly check my website URL. https://www.removeload.com/c-operators
0 notes
shrine-of-the-exoletus · 18 days ago
Text
Tumblr media
Why didn't yandev use the ternary operator to reduce typing? The syntax looks so much neater
3 notes · View notes
ultimateplaylistmaker · 3 months ago
Note
Speaking of balanced ternary, there's this post about some MineCraft computer that uses it (tumblr.com/piratesexmachine420/763076232351006720/the-theory-of-operation-for-my-balanced-ternary?source=share) and I think Miu would do that shit.
I appreciate the link but my eyes just crossed no wait I just noticed the blog name we're so back that's cool as hell
2 notes · View notes