• Chuck Lester (unregistered) in reply to dhromed
    dhromed:
    I'd like to see some code that almost adds 11.Preferrably by introducing floating point errors.

    What about...?

    final float THIRTY_FIVE = 34.56; x += THIRTY_FIVE / Math.PI

  • sharpcoder (unregistered)

    I think I have a solution that hasn't been proposed yet! It's an extension of the Monte Carlo Method.

            private int increment(int number, int value)
            {
                var rand = new Random();
                while (true)
                {
                    var cur = rand.Next(int.MinValue, int.MaxValue);
                    if (cur == number + value)
                        return cur;
                }
            }
    

Leave a comment on “If ++ Increments ... (++)”

Log In or post as a guest

Replying to comment #:

« Return to Article