How to add UInt128 structure, constructor, properties and methods to my VS2022 C# program?

rich beck 20 Reputation points
2023-07-24T13:53:41.9233333+00:00

I have found System.Numerics.BigInteger and that works great in my C# and VB.net code;

But i see no reference or option to include the UInt128 structure and class; is it in a reference type that I need to include? It is not listed as an option under System.Numerics

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,921 questions
{count} votes

1 answer

Sort by: Most helpful
  1. P a u l 10,231 Reputation points
    2023-07-24T16:31:16.6566667+00:00

    It's in the System namespace, so provided that you're using "implicit usings" then you shouldn't need to include anything.

    Are you using .NET 7/8? Currently it looks like the is only supported in those versions:

    https://learn.microsoft.com/en-us/dotnet/api/system.uint128?view=net-7.0#applies-to