1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 22:12:53 +08:00

use isNormal to validate ratio

This commit is contained in:
Jay Lawton 2025-01-15 20:13:11 +10:00
parent 7cf216dd34
commit e2a94ecf56

View File

@ -22,11 +22,11 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
}
/// <summary>
/// To prevent against infinite ratio values where maps breach regular mapping conditions, we validate the ratio.
/// Validates the ratio by ensuring it is a normal number in cases where maps breach regular mapping conditions.
/// </summary>
private static double validateRatio(double ratio)
{
return double.IsInfinity(ratio) || double.IsNaN(ratio) ? 0 : ratio;
return double.IsNormal(ratio) ? ratio : 0;
}
/// <summary>