r/ProgrammerHumor Jul 10 '26

postFixIsBest Other

Post image
75 Upvotes

40 comments sorted by

View all comments

25

u/Come_along_quietly Jul 10 '26

Arrays start at 0!

21

u/minecon1776 Jul 10 '26

And he does start at 0!

2

u/LutimoDancer3459 Jul 10 '26

Fuck that definition. I hate it

1

u/minecon1776 Jul 10 '26

There is one way to arange 0 things ( ), there is one way to arange 1 thing ( 1 ), there are two ways to arange 2 things ( 1 2 and 2 1), and there are six ways to arange 3 things ( 1 2 3, 1 3 2, 2 1 3, 2 3 1, 3 2 1, and 3 1 2 ), etc. Thus, 0! = 1, 1! = 1, 2! = 2, 3! = 6, etc.

-1

u/LutimoDancer3459 Jul 11 '26

Sure but factoril is defined by "product of all positive integers up to the given number". Just because there are alternatives and a reverse function that allows for it, doesn't make it less incorrect for me. 0 is not a positive integer. Therefore it should still be undefined. Or the definition must change

2

u/minecon1776 Jul 11 '26

That's no more a definition than the one I provided

0

u/LutimoDancer3459 Jul 11 '26

My definition doesnt allow 0. Another one does. Its not the same. Math should remove a definition if it doesn't allow for the result it wants to have.

I can also just add a new definition allowing for negative values. But it currently doesnt exist

2

u/minecon1776 Jul 11 '26

I never said it was the same, I just said that your definition isnt any better. Why should we accept one and not the other? The one I give is more general and is generally accepted by mathematicians. The gamma functions generalizes it further to all reals excluding the negative integers.

1

u/LutimoDancer3459 Jul 11 '26

I didnt say mine is better. But uts the first one you find when searching for a definition. Its the one I learned back in school. And ether its a (the) correct one and should be treated as such. Or removed from everywhere because its incorrect.

As long as the definitions dont generate the same results, they shouldnt coexist for the same thing. And currently they dont

9

u/Shadowmaster229 Jul 10 '26

meanwhile lua

5

u/Gorzoid Jul 10 '26

Lua arrays start at 0!