Skip to content

Commit e732655

Browse files
authored
Add Convert.ToBolean(byte) (#111)
***NO_CI***
1 parent 28b3690 commit e732655

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

nanoFramework.CoreLibrary/System/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
[assembly: AssemblyProduct("nanoFramework mscorlib")]
1515
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]
1616

17-
[assembly: AssemblyNativeVersion("100.5.0.0")]
17+
[assembly: AssemblyNativeVersion("100.5.0.1")]

nanoFramework.CoreLibrary/System/Convert.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ public static class Convert
3636

3737
[MethodImpl(MethodImplOptions.InternalCall)]
3838
private static extern double NativeToDouble(string value);
39+
/// <summary>
40+
/// Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value.
41+
/// </summary>
42+
/// <param name="value">The 8-bit unsigned integer to convert.</param>
43+
/// <returns><see langword="true"/> if <paramref name="value"/> is not zero; otherwise, <see langword="false"/>.</returns>
44+
public static bool ToBoolean(byte value)
45+
{
46+
return value != 0;
47+
}
3948

4049
/// <summary>
4150
/// Converts the value of the specified 16-bit unsigned integer to its equivalent Unicode character.

0 commit comments

Comments
 (0)