Why might different computers calculate different arithmetic results in VB.NET?
- by Eyal
I have some software written in VB.NET that performs a lot of calculations, mostly extracting jpegs to bitmaps and computing calculations on the pixels like convolutions and matrix multiplication. Different computers are giving me different results despite having identical inputs. What might be the reason?
Edit: I can't provide the algorithm because it's proprietary but I can provide all the relevant operations:
ULong \ ULong (Turuncating division)
Bitmap.Load("filename.bmp') (Load a bitmap into memory)
Bitmap.GetPixel(Integer, Integer) (Get a pixel's brightness)
Double + Double
Double * Double
Math.Sqrt(Double)
Math.PI
Math.Cos(Double)
ULong - ULong
ULong * ULong
ULong << ULong
List.OrderBy(Of Double)(Func)
Hmm... Is it possible that OrderBy is using a non-stable QuickSort and that QuickSort is using a random pivot? Edit: Just tested, nope. The sort is stable.