Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a unsigned 128bit Integer Datatype for the .net Framework [duplicate]

Tags:

c#

.net

Possible Duplicate:
Int128 in .Net?

as I'm working on a tool which manages IP devices and I'd like to add IPv6 Support to it, I'm searching for a 128bit unsigned Integer .net Datatype to do basic IP related calculations (Subnetting, List all Hosts for a Subnet, ..)

It should support the standard arithmetic/logic methods.

Thank you :)

like image 906
leen Avatar asked Sep 02 '11 12:09

leen


People also ask

How do you write a 128-bit integer?

DrinkMoreBoilingWater's blog. As an extension the integer scalar type __int128 is supported for targets which have an integer mode wide enough to hold 128 bits. Simply write __int128 for a signed 128-bit integer, or unsigned __int128 for an unsigned 128-bit integer.

Is there Int128?

An Int128 is the "natural" type of GUID, IP6 addresses and more at low level but nevertheless true x86 instruction CPUID returns 4 integers (in 4 registers) that need to be "concatenated" to get the real value, the real "intent" was to return an Int128.

How many digits is a 128-bit number?

The 128-bit data type can handle up to 31 significant digits (compared to 17 handled by the 64-bit long double). However, while this data type can store numbers with more precision than the 64-bit data type, it does not store numbers of greater magnitude.

What is __ Int128 in C++?

The int128 type defines a signed 128-bit integer. The API is meant to mimic an intrinsic integer type as closely as possible, so that any forthcoming int128_t can be a drop-in replacement. The int128 type supports the following: Implicit conversion from signed integral types and unsigned types narrower than 128 bits.


1 Answers

in this article the author describes and shows how to implement the Int128 datatype in .NET: http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=636

also please search here in SO before posting :)

Int128 in .Net?

like image 82
Davide Piras Avatar answered Nov 08 '22 15:11

Davide Piras