I am writing a class which needs accurate division of the BigInteger class in C#.
Example:
BigInteger x = BigInteger.Parse(\"10000000000000000000000
//b = 10x bigger as a => fraction should be 0.1
BigInteger a = BigInteger.Pow(10, 5000);
BigInteger b = BigInteger.Pow(10, 5001);
//before the division, multiple by a 1000 for a precision of 3, afterwards
//divide the result by this.
var fraction = (double) BigInteger.Divide(a * 1000, b) / 1000;