diff --git a/X10D/src/BooleanExtensions.cs b/X10D/src/BooleanExtensions.cs index d4d3d82..1d81fda 100644 --- a/X10D/src/BooleanExtensions.cs +++ b/X10D/src/BooleanExtensions.cs @@ -12,7 +12,7 @@ /// Returns 1 if is , or 0 otherwise. public static byte ToByte(this bool value) { - return (byte)value.ToInt32(); + return value ? 1 : 0; } /// @@ -22,7 +22,7 @@ /// Returns 1 if is , or 0 otherwise. public static short ToInt16(this bool value) { - return (short)value.ToInt32(); + return value.ToByte(); } /// @@ -32,7 +32,7 @@ /// Returns 1 if is , or 0 otherwise. public static int ToInt32(this bool value) { - return value ? 1 : 0; + return value.ToByte(); } /// @@ -42,7 +42,7 @@ /// Returns 1 if is , 0 otherwise. public static long ToInt64(this bool value) { - return value.ToInt32(); + return value.ToByte(); } } }