rspec/rules/S925/compliant.adoc

14 lines
175 B
Plaintext
Raw Normal View History

=== Compliant solution
2020-06-30 12:50:59 +02:00
2022-02-04 17:28:24 +01:00
[source,text]
2020-06-30 12:50:59 +02:00
----
int pow(int num, int exponent) {
int val = num;
while (exponent > 0) {
val *= num;
--exponent;
}
return val;
}
----