mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Use float.IsFinite in some appropriate places previously using IsNan || IsInfinity
This commit is contained in:
@@ -112,7 +112,7 @@ namespace Robust.Shared.Maths
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float NextPowerOfTwo(float n)
|
||||
{
|
||||
if (float.IsNaN(n) || float.IsInfinity(n))
|
||||
if (!float.IsFinite(n))
|
||||
throw new ArgumentOutOfRangeException(nameof(n), "Must be a number.");
|
||||
if (n <= 0) throw new ArgumentOutOfRangeException(nameof(n), "Must be positive.");
|
||||
return (float) NextPowerOfTwo((double) n);
|
||||
@@ -126,7 +126,7 @@ namespace Robust.Shared.Maths
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static double NextPowerOfTwo(double n)
|
||||
{
|
||||
if (double.IsNaN(n) || double.IsInfinity(n))
|
||||
if (!double.IsFinite(n))
|
||||
throw new ArgumentOutOfRangeException(nameof(n), "Must be a number.");
|
||||
if (n <= 0) throw new ArgumentOutOfRangeException(nameof(n), "Must be positive.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user