Compare divide by zeroes and be ignored, is this universal across computer code?

float zero=0;

if(zero/abs(zero)==zero/abs(zero)){ellipse(200,200,200,200);}

Is this a processing fail-safe or a universal thing across computer code?

Edit: wait nevermind, it’s a stupid question since c++ can show infinity when displaying divide by zero results.

I don’t think it’s a stupid question ! :slightly_smiling_face:

So I’ve tried print(9/0); !

Processing :

  • “Aritmetic Exception : /0”

P5js

  • Infinity

Python3

No idea because the Python module does not start with Processing 3 and this line crashes Processing 4.4.4 :shaking_face:

Python Python

According to Mr or Mrs Internet, the division by zero in Python gives: ZeroDivisionError:division by zero.

So, When there is A / B, it may be good to test before if B=0 (if it may happens). :slightly_smiling_face: