2

Why isn't this code idempotent?

double.Parse(double.MinValue.ToString())

This will throw an OverflowException with the message

Value was either too large or too small for a Double

I would expect this expression to result in a double whose value was equal to double.MinValue. What is the reason it fails?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
  • @HansPassant, makes sense, but unfortunate in terms of "pit of success" criteria... But thanks for sharing. – Kirk Woll Sep 07 '16 at 22:35

0 Answers0