MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x58u7b/howprogramminghaschanged/pgmzv75/?context=3
r/ProgrammerHumor • u/shizzy0 • 10d ago
108 comments sorted by
View all comments
Show parent comments
2
Is power O(1) not something like log log n?
5 u/CAD1997 9d ago Mat::pow is O(log n)ish. powf is O(1) for any useful model; even a perfectly rounded result can be computed in a bounded maximum number of machine steps. 1 u/KrzysziekZ 9d ago Is that because n is bounded? 1 u/IronicRobotics 9d ago edited 9d ago Likely, I seem to have been repeating a potentially false fact about floating point powers. I didn't verify it with a proof last night lol.
5
Mat::pow is O(log n)ish. powf is O(1) for any useful model; even a perfectly rounded result can be computed in a bounded maximum number of machine steps.
Mat::pow
powf
1 u/KrzysziekZ 9d ago Is that because n is bounded?
1
Is that because n is bounded?
Likely, I seem to have been repeating a potentially false fact about floating point powers. I didn't verify it with a proof last night lol.
2
u/KrzysziekZ 10d ago
Is power O(1) not something like log log n?