Skip to content

Commit 01f1123

Browse files
committed
Fix types
1 parent 3cd69c3 commit 01f1123

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/LibStored.Net/Types.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-FileCopyrightText: 2025 Guus Kuiper
2-
//
2+
//
33
// SPDX-License-Identifier: MIT
44

55
namespace LibStored.Net;
@@ -83,12 +83,12 @@ public enum Types : byte
8383
/// <summary>
8484
/// Native signed integer type (platform size).
8585
/// </summary>
86-
Int = Types.FlagFixed | Types.FlagInt | (sizeof(int) - 1),
86+
Int = Types.FlagFixed | Types.FlagInt | Types.FlagSigned | (sizeof(int) - 1),
8787

8888
/// <summary>
8989
/// Native unsigned integer type (platform size).
9090
/// </summary>
91-
Uint = Types.FlagFixed | (sizeof(uint) - 1),
91+
Uint = Types.FlagFixed | Types.FlagInt | (sizeof(uint) - 1),
9292

9393
/// <summary>
9494
/// 32-bit floating point type.

src/LibStored.Net/TypesExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ public static class TypesExtensions
3939
/// <returns>True if the type is signed; otherwise, false.</returns>
4040
public static bool IsSigned(this Types type) => (type & Types.FlagSigned) != 0;
4141

42+
/// <summary>
43+
/// Determines whether the type is a floating point number.
44+
/// </summary>
45+
/// <param name="type">The type to check.</param>
46+
/// <returns>True if the type is floating point number; otherwise, false.</returns>
47+
public static bool IsFloat(this Types type) => type.IsFixed() && type.IsSigned() && !type.IsInt();
48+
4249
/// <summary>
4350
/// Determines whether the type is a special type (undefined length).
4451
/// </summary>

0 commit comments

Comments
 (0)