diff --git a/X10D/src/DoubleExtensions/DoubleExtensions.cs b/X10D/src/DoubleExtensions/DoubleExtensions.cs index d53537d..8605a86 100644 --- a/X10D/src/DoubleExtensions/DoubleExtensions.cs +++ b/X10D/src/DoubleExtensions/DoubleExtensions.cs @@ -130,6 +130,18 @@ namespace X10D.DoubleExtensions return Math.Round(value / nearest) * nearest; } + /// + /// Converts the value of the current double-precision floating-point number to an equivalent Boolean value. + /// + /// The value to convert. + /// + /// if is not zero, or otherwise. + /// + public static bool ToBoolean(this float value) + { + return value != 0.0; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static double LerpInternal(double a, double b, double t) { diff --git a/X10D/src/SingleExtensions/SingleExtensions.cs b/X10D/src/SingleExtensions/SingleExtensions.cs index fe91ef0..185a28e 100644 --- a/X10D/src/SingleExtensions/SingleExtensions.cs +++ b/X10D/src/SingleExtensions/SingleExtensions.cs @@ -131,6 +131,18 @@ namespace X10D.SingleExtensions return (float)((double)value).Round(nearest); } + /// + /// Converts the value of the current single-precision floating-point number to an equivalent Boolean value. + /// + /// The value to convert. + /// + /// if is not zero, or otherwise. + /// + public static bool ToBoolean(this float value) + { + return value != 0.0f; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static float LerpInternal(float a, float b, float t) {