Why can different computers calculate different arithmetic results in VB.NET?

I have software written in VB.NET that does a lot of calculations, basically extracts jpegs for bitmaps and calculates calculations on pixels like convolutions and matrix multiplication. Different computers give me different results, despite the fact that they have the same input. What could be the reason?

Edit : I cannot provide an algorithm because it is proprietary, but I can provide all the relevant operations:

  • ULong \ ULong (truncation division)
  • Bitmap.Load ("filename.bmp ') (Loading a bitmap into memory)
  • Bitmap.GetPixel (Integer, Integer) (get pixel 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 uses unstable QuickSort and that QuickSort uses a random kernel? Edit : just tested, no. The variety is stable.

+4
source share
3 answers

It turns out that Bitmap.Load ("filename.jpeg") does not always create the same bitmap on each computer. I still don’t know why this is so.

+2
source
  • one or more software errors (e.g. uninitialized variables)?

  • old intel floating point processor?

  • a numerically unstable algorithm?

+1
source

Screen drivers. Each driver will display values ​​differently. Although the number of pixels is the same, the color depth may vary depending on the screen drivers. Now tune in to the array and compare this array on these machines, you can see the difference in a few bytes.

I would print $ totals and see what they add to

+1
source

Source: https://habr.com/ru/post/1303708/


All Articles