Pollarity

Mapping humanity

Poll - 0 gedeeld door 0

en
0 gna, 15 oktober 2007 15:16
gnamost often i would rather have 0 as the outcome, than to get an error message...
en
0 gna, 15 oktober 2007 23:25
gnaadded 1 as an option, i can image people would vote that because x / x is always 1 except for 0 or (-)infinity
en
0 Necrathex, 16 oktober 2007 10:47
NecrathexIn a programming language you'd never put a literary 0/0 in the code, it will mostly be some variable divided by some other variable (a/b); therefore whenever b = 0 there should be a division by zero error, regardless of the value of a.
en
0 gna, 16 oktober 2007 15:28
gnabut for example, in game programming you want the arctan of dy/dx to get the angle. There i would like to have the option to get 0 as outcome, it sucks to have to do a try catch or to check if the outcome isNaN only for the rare case that 2 objects have the same position. Then i would manually set the angle to 0 anyway :)