perf(xp): simplify function LevelXP

This commit is contained in:
Anhgelus Morhtuuzh 2025-05-13 23:44:16 +02:00
parent 8f10267e2d
commit 0f5f1ade0b
Signed by: anhgelus
GPG key ID: CAD341EFA92DDDE5
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ Functions:
message (number of different rune)
- $xp-vocal(x)=0.01 x^{1.3}+1$ where $x$ is the time spent in vocal (in second)
- $level(x)=0.2 \sqrt{x}$ where $x$ is the xp
- $level^{-1}(x)=(5x)^2$ where $x$ is the level
- $level^{-1}(x)=25x^2$ where $x$ is the level
## Installation

View file

@ -42,7 +42,7 @@ func Level(xp uint) uint {
// See Level to get the level with the given XP.
func LevelXP(level uint) uint {
return uint(math.Floor(
math.Pow(float64(5*level), 2),
25 * math.Pow(float64(level), 2),
))
}