Spot the Bug
Ran into this recently and thought it might be interesting.
Can you try and spot the bug and the possible error that can occur with the following lines of code?
Decimal randomDoubleAsDecimal()
{
Random rand = new Random();
return Decimal.Parse(rand.NextDouble().ToString());
} Solution in the next post.
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using