impr(calc): negative result of play_rating_from_step

This commit is contained in:
283375 2023-09-21 11:36:00 +08:00
parent 0c292fc3be
commit 3867b273c7
Signed by: 283375
SSH Key Fingerprint: SHA256:UcX0qg6ZOSDOeieKPGokA5h7soykG61nz2uxuQgVLSk

View File

@ -172,4 +172,4 @@ def calculate_play_rating_from_step(
play_rating_sqrt = (Decimal(50) * step - Decimal("2.5") * partner_step_value) / (
Decimal("2.45") * partner_step_value
)
return play_rating_sqrt**2
return play_rating_sqrt**2 if play_rating_sqrt >= 0 else -(play_rating_sqrt**2)