C# BigInteger Explicit(BigInteger to UInt32)

Description

BigInteger Explicit(BigInteger to UInt32) Defines an explicit conversion of a BigInteger object to an unsigned 32-bit integer value.

Syntax

BigInteger.Explicit(BigInteger to UInt32) has the following syntax.


public static explicit operator uint (
  BigInteger value
)

Parameters

BigInteger.Explicit(BigInteger to UInt32) has the following parameters.

  • value - The value to convert to an unsigned 32-bit integer.

Returns

BigInteger.Explicit(BigInteger to UInt32) method returns An object that contains the value of the value parameter.

Example


//  w  ww.jav a 2 s  .  co  m
using System;
using System.IO;
using System.Numerics;

public class Example
{
    public static void Main()
    {
        BigInteger goodUInteger = 200000;
        BigInteger badUInteger = 65000000000;

        uint uIntegerFromBigInteger;

        // Successful conversion using cast operator. 
        uIntegerFromBigInteger = (uint)goodUInteger;
        Console.WriteLine(uIntegerFromBigInteger);


        uIntegerFromBigInteger = (uint)badUInteger;
        Console.WriteLine(uIntegerFromBigInteger);


    }
}




















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex