MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x58u7b/howprogramminghaschanged/pgmzv75/
r/ProgrammerHumor • u/shizzy0 • Oct 13 '26
108 comments sorted by
View all comments
Show parent comment
2
Is power O(1) not something like log log n?
5 u/CAD1997 Oct 14 '26 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 Oct 14 '26 Is that because n is bounded? 1 u/IronicRobotics Oct 14 '26 edited Oct 14 '26 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 Oct 14 '26 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.
View all comments
Show parent comment
2
u/KrzysziekZ Oct 14 '26
Is power O(1) not something like log log n?