@night_of_knee@lemmy.world to Programmer Humor@lemmy.ml • 2 years agoCan we finally put this one to rest?lemmy.worldimagemessage-square13fedilinkarrow-up1168arrow-down110file-text
arrow-up1158arrow-down1imageCan we finally put this one to rest?lemmy.world@night_of_knee@lemmy.world to Programmer Humor@lemmy.ml • 2 years agomessage-square13fedilinkfile-text
minus-squareThe Quuuuuilllinkfedilink16•2 years agoif (a < b) { return true; } else if (b < a) { return false; } else { return "A == B, bro" }
minus-square@nodiet@feddit.delinkfedilink2•2 years agoThat 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)
if (a < b) { return true; } else if (b < a) { return false; } else { return "A == B, bro" }
That doesn’t work if either one is NaN
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)
typed languages seeing this