I am trying to convert from python to C#
python:
rand = random.randint(0, 2 ** 50)
and here's what I did in C#
var value = Math.Pow(2, 50);
var result = random.Next(0, Convert.ToInt32(value));
I'm getting this error
Unhandled exception. System.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
I wanted to generate from range 0 to value