There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

eeleech ,
<pre style="background-color:#ffffff;">
<span style="color:#323232;">(when-not (> a b) (> b a))
</span>
tyo_ukko ,

One can tell you’re a quality poster for putting a reference to a freaking programming meme. It is an overkill, but a quality overkill.

r00ty Admin ,
r00ty avatar

Meanwhile, in the background the compiler optimizes them all to the same result anyway. :P

tuto193 ,

This is missing one at the very top that’s just:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">return a < b
</span>
Quill7513 ,
<pre style="background-color:#ffffff;">
<span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(a </span><span style="font-weight:bold;color:#a71d5d;">< </span><span style="color:#323232;">b) {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#0086b3;">true</span><span style="color:#323232;">;
</span><span style="color:#323232;">} </span><span style="font-weight:bold;color:#a71d5d;">else if </span><span style="color:#323232;">(b </span><span style="font-weight:bold;color:#a71d5d;">< </span><span style="color:#323232;">a) {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#0086b3;">false</span><span style="color:#323232;">;
</span><span style="color:#323232;">} </span><span style="font-weight:bold;color:#a71d5d;">else </span><span style="color:#323232;">{
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#183691;">"A == B, bro"
</span><span style="color:#323232;">}
</span>
Lachy ,

That doesn’t work if either one is NaN

nodiet ,

That is literally how we implemented an algorithm to check for equivalence in a privacy preserving way. Only that you can't check the results of the evaluation so you have to do 1-(a<b)-(b<a)

darcy ,
@darcy@sh.itjust.works avatar

typed languages seeing this

Huschke ,

Why is there no space in front of the ?. At first I didn’t even realize that this was supposed to be the ternary operator.

lowleveldata ,

Why is this its own function in the first place

MrJukes ,
@MrJukes@lemmy.one avatar

We don’t know what the rest of the function looks like or what the inputs are.

lowleveldata ,

How complex can it be when the results are named a and b?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines