Style cleanup
This commit is contained in:
@@ -13,7 +13,7 @@ public static class NumericHelpers
|
||||
var result = value * multiplier;
|
||||
return result > byte.MaxValue ? byte.MaxValue : (byte)result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two values. If this overflows, returns <see cref="byte.MaxValue"/>.
|
||||
/// </summary>
|
||||
@@ -22,7 +22,7 @@ public static class NumericHelpers
|
||||
var result = value * multiplier;
|
||||
return result > byte.MaxValue ? byte.MaxValue : (byte)result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two values. If this overflows, returns <see cref="sbyte.MaxValue"/>.
|
||||
/// </summary>
|
||||
@@ -31,7 +31,7 @@ public static class NumericHelpers
|
||||
var result = value * multiplier;
|
||||
return result > sbyte.MaxValue ? sbyte.MaxValue : (sbyte)result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two values. If this overflows, returns <see cref="ushort.MaxValue"/>.
|
||||
/// </summary>
|
||||
@@ -40,7 +40,7 @@ public static class NumericHelpers
|
||||
var result = value * multiplier;
|
||||
return result > ushort.MaxValue ? ushort.MaxValue : (ushort)result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two values. If this overflows, returns <see cref="short.MaxValue"/>.
|
||||
/// </summary>
|
||||
@@ -49,11 +49,10 @@ public static class NumericHelpers
|
||||
var result = value * multiplier;
|
||||
return result > short.MaxValue ? short.MaxValue : (short)result;
|
||||
}
|
||||
|
||||
|
||||
public static uint MultiplyOrMax(this uint value, uint multiplier)
|
||||
{
|
||||
var result = (ulong)value * multiplier;
|
||||
return result > uint.MaxValue ? uint.MaxValue : (uint)result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user