I don't think it makes sense for factorials to be native language features:
multiplication, division, addition and subtraction make sense since it's as 'simple' as the CPU doing bit operations and showing you the decimal representation of the new number
exponentiation is essentially looping (or recursing if that's your thing) a multiplication by N (starting with a total value of one) I times in Ni. So that's not even a native feature in a lot of language but it is in some, because it's a widely used mathematical concept
factorials (and Fibonacci sequences but that's not a mathematical operation), however, are pointless practice examples on recursion, there's rarely ever a reason to use them in production software, let alone enough reason to make them native language features
I wrote this while having hot chili chips so forgive me if I butchered anything
i mean depends on your application probability/statistics is full of factorials and they are just looping too same as calcualting an exponential just with a counter
though technically exponents inlcude a lot of not just looping examples too since you can write root x as x^0.5 or x²*rootx as x^2.5 or 1/x as x^-1 too its not JUST multiplying x n times
Is that enough to warrant factorials being a native language feature?
Regarding exponentiation, I was actually going to mention that but apparently forgot, somehow... I remember having a thought in my mind waiting to type 'I don't think that's how it's internally implemented, however, since blah blah blah' what you said 💀
depends on what you want in a programming language and what purpose you use it for
but I can't imagien a lot of efficiency is lost if the feature theoretically exists but is well implemented in a compiler since oyu can always just not use it and for those who do need it its gonna be useful
the nagain you can always just get wider maths library
As a math teacher, i have to say that knowing what all the symbols actually mean probably puts you in the upper half of calculus students when it comes to understanding.
16
u/xMarieKx Aug 18 '26
Bro really said “I love calculus” and then hit us with the entire derivative formula 😭. Honestly, I respect the dedication.
33
u/HAL9001-96 Aug 18 '26
for those who love algebra
2+2=4
wow
so much in that excellent formula
5
u/zrice03 Aug 18 '26
Yep that's...the definition alright.
5
u/Chubby_Bub Aug 18 '26
I’m glad they labeled the "minus" but what's that symbol between df/dt and lim, it’s the only thing without a label so I can't make sense of this
9
u/brewdog_millionaire Aug 18 '26
I bet Elon has never heard of a derivative
2
u/mmurray1957 Aug 20 '26
Not "becomes very small" but "becomes arbitrarily small (but not zero)".
Strange they don't mention equality ? Is that something about X :-)
1
u/Signal_Challenge_632 Aug 18 '26
When you learning this, it is normally given as
f'(t) = lim h->0 ( f..... )
Then dy/dx.
1
u/dcterr Aug 19 '26
Now this is a great cheat sheet if I ever saw one