Some .NET languages may not support unsigned types, so .NET APIs shouldn't use them. See here.
.NET API, more appropriate parameter specification, e.g. System.Random.Next(Int32 to UInt32)
Daniel Domanski
20
Reputation points
Hi,
I'm working with the .NET (C#) learning-modules and was instructed to have a look at the Random-class with its Next Method and the overloaded version with 1 parameter.
According to the parameter section the value has to be equals or higher than 0/zero. I already know about the UInt32 value type, which fits perfectly to the mentioned constraint.
Shouldn't it be changed from Int32 to UInt32 then?
Best Regards
Daniel
.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
Accepted answer
1 additional answer
Sort by: Most helpful
-
Daniel Domanski 20 Reputation points
2023-06-10T11:03:09.6266667+00:00 If someone seeing this is searching for CLS-compliant alternatives for such data types.
Types and type-member signatures, CLS-compliant alternatives