BigInteger casting

Implicitly cast a BigInteger to a standard numeric type and explicitly cast in the other direction.

For instance:


using System;
using System.Numerics;

class Sample
{
    public static void Main()
    {
        double g1 = 1e100;  // implicit cast 
        BigInteger g2 = (BigInteger)g1;  // explicit cast 
        Console.WriteLine(g2);
    }
}

The output:


10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.