Task
Take the (integer) number of human years that the dog has lived, \$n\$, as input and return its age in dog years, \$d\$, to two decimal places.
The number of human years, \$n\$, will be between \$1\$ and \$122\$ inclusive: \$n \in [1,122], n \in \Bbb{N}\$.
According to BBC's Science Focus Magazine, the correct function for determining your dog's age is: $$ n = 16 \times \ln(d) + 31 $$ Where
\$n\$ is the age in human years
\$d\$ is the age in dog years
Rules
The final output in dog years must be a decimal, rounded to 2 decimal places.
28874468684703116351749853
point something, while a simple calculation with doubles returns28874468684703116489129984.00
. Are you sure you want to set the upper limit to such a high value? \$\endgroup\$0.5
is an acceptable output when given an input of20
[rather than0.50
]) \$\endgroup\$n
andd
are the wrong way around. From the source paper: (equivalent) human_age = 16 ln(dog_age) + 31 \$\endgroup\$