558445a88826e1376b000011
This commit is contained in:
14
src/558445a88826e1376b000011.js
Normal file
14
src/558445a88826e1376b000011.js
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
const age = (x, y) => {
|
||||
const s = Math.sign(x);
|
||||
let n = 100;
|
||||
for (let i = 0; i < 1000; ++i) {
|
||||
n += x * s;
|
||||
n /= y ** s;
|
||||
}
|
||||
return s > 0 ? x + n : n;
|
||||
};
|
||||
|
||||
age(-15, 0.25);
|
||||
age(6, 3);
|
||||
age(30, 1.4918032786885247);
|
||||
Reference in New Issue
Block a user