In algebra, when you do any number divided by 0, you technically get “No Solution”, what should give is in scripting, nil. When you do like print(1/0), it prints “1.#INF”. This a bug of sorts? :uhhh:
1.#Infinite
From Wikipedia page about dividing by zero:
Emphasis added.
(-1/0) = -INF, (1/-0) = -INF, (1/0) = INF, this is the way several programming languages deal with that scenario and it’s a whole lot better than returning an error.
Vector3.new(0,0,0).unit was resulting as NAN, NAN, NAN (forgot to take velocities being 0,0,0 into account) instead of erroring. I had to search through some AI code to find out what was removing two vital models,one empty and the other with a part that had a BodyPosition which used the NAN, NAN, NAN, and the part kept removing itself AND the two models leading me to believe the error was somewhere else entirely. A warning at least would be nice with these cases instead of no output at all.
1/00~=1/00
just for fun
0/0 is answerable by every number.
Even my math teacher says 0/0 is no solution, and I am in Honors Algebra… :uhhh:
Even my math teacher says 0/0 is no solution, and I am in Honors Algebra… :uhhh:[/quote]
Because, there is no way to divide nothing from nothing.
Don’t worry about it, I use it in my game and it gives me a -1 back. It’s really not worth fighting over.
In Math, there’s no solution.
In Computer Science and the development world, “No Solution” isn’t an option and will get you fired.
0 goes into 1 an infinite number of times, resulting in a math error, while native Lua could hard-code this to return nil instead, what would be the purpose?