Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
nocgod17557yComputer science is a subdivision of math. You are still doing math just don't see it... ;)
-
loop597yYeah, mathematics and computing are related, but what's up with that function? I can't image a situation where declaring a function for that would be useful. At least go a little more generic:
function pow(x,y) {
var z = x;
while (y > 1) {
z *= x;
y--;
}
return z;
}
(Yep, this only does positive powers, still)
Or just use Math.pow(). (That's js but all languages have math libraries)
Related Rants
That moment when you realise f(x)=x²
that you did in 4th grade and now
Function(x){
return x*x;
}
....😯😮😲😱😵...
You realise that Everyone has been doing programming all their life....
undefined
programming
math