night_of_knee@lemmy.world to Programmer Humor@lemmy.ml · il y a 3 ansCan we finally put this one to rest?lemmy.worldimagemessage-square13linkfedilinkarrow-up1170arrow-down19file-text
arrow-up1161arrow-down1imageCan we finally put this one to rest?lemmy.worldnight_of_knee@lemmy.world to Programmer Humor@lemmy.ml · il y a 3 ansmessage-square13linkfedilinkfile-text
minus-squareThe Quuuuuill@slrpnk.netlinkfedilinkarrow-up16arrow-down1·il y a 3 ansif (a < b) { return true; } else if (b < a) { return false; } else { return "A == B, bro" }
minus-squareLachy@lemmy.worldlinkfedilinkarrow-up6·il y a 3 ansThat doesn’t work if either one is NaN
minus-squarenodiet@feddit.delinkfedilinkarrow-up2·il y a 3 ansThat 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