▲ 197 ▼ Fun fact: you can't upload this image on piefed.social (thelemmy.club) submitted 7 months ago by irelephant@lemmy.dbzer0.com to c/fediverse@lemmy.world 177 comments fedilink hide all child comments https://codeberg.org/rimu/pyfedi/src/commit/6405e51dab23f43eaea18d0ee4d9e7a773a3fd31/app/community/forms.py#L335 deliberately misleading error message.
[–] BB84@mander.xyz 13 points 7 months ago (3 children) not if both upvotes and downvotes are zero ❗️ permalink fedilink source parent hideshow 3 child comments replies: [–] magiccupcake@lemmy.world 22 points 7 months ago (2 children) If 0/0 < 0 would error? If 0 < 0 evaluates false That makes it even worse??? permalink fedilink source parent hideshow 2 child comments replies: [–] BB84@mander.xyz 6 points 7 months ago (1 child) Usually 0/0=NaN and NaN compared with a number would be false. Maybe the (up-down)/(up+down) is just what AmazingWizard summarized from the code. But from what we have seen of the quality of that codebase I won't be surprised if it's literally this expression, division by zero and all. Lol permalink fedilink source parent hideshow 1 child comment replies: [–] Edie@lemmy.ml 4 points 7 months ago* The (upvotes cast - downvotes cast) / (upvotes + downvotes) is what the code itself says Here's recalculate_attitude, line 1268 checks that they have at least made 10 votes. permalink fedilink source parent
[–] magiccupcake@lemmy.world 22 points 7 months ago (2 children) If 0/0 < 0 would error? If 0 < 0 evaluates false That makes it even worse??? permalink fedilink source parent hideshow 2 child comments replies: [–] BB84@mander.xyz 6 points 7 months ago (1 child) Usually 0/0=NaN and NaN compared with a number would be false. Maybe the (up-down)/(up+down) is just what AmazingWizard summarized from the code. But from what we have seen of the quality of that codebase I won't be surprised if it's literally this expression, division by zero and all. Lol permalink fedilink source parent hideshow 1 child comment replies: [–] Edie@lemmy.ml 4 points 7 months ago* The (upvotes cast - downvotes cast) / (upvotes + downvotes) is what the code itself says Here's recalculate_attitude, line 1268 checks that they have at least made 10 votes. permalink fedilink source parent
[–] BB84@mander.xyz 6 points 7 months ago (1 child) Usually 0/0=NaN and NaN compared with a number would be false. Maybe the (up-down)/(up+down) is just what AmazingWizard summarized from the code. But from what we have seen of the quality of that codebase I won't be surprised if it's literally this expression, division by zero and all. Lol permalink fedilink source parent hideshow 1 child comment replies: [–] Edie@lemmy.ml 4 points 7 months ago* The (upvotes cast - downvotes cast) / (upvotes + downvotes) is what the code itself says Here's recalculate_attitude, line 1268 checks that they have at least made 10 votes. permalink fedilink source parent
[–] Edie@lemmy.ml 4 points 7 months ago* The (upvotes cast - downvotes cast) / (upvotes + downvotes) is what the code itself says Here's recalculate_attitude, line 1268 checks that they have at least made 10 votes. permalink fedilink source parent