Valgrind

Vasily Postnicov shamaz.mazum at gmail.com
Tue Feb 2 11:55:23 PST 2016


Interesting piece of software) I'll try to check later if 'which' array
index you are getting (in quite interesting way, using floating point math,
as I see) is correct. I think that calculating array index with floating
point arithmetic is wrong. Imagine what can happen if you have an array of
three elements and result of floating point operations will be 3.0000001
instead of 2.999999 due to floating point limited precision. You will get
wrong array index (3 instead of 2) and so your result will be wrong.
Try to add a debugging conditional if 'which' is out of range. This will
help more than wasting your time on valgrind.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20160202/4cf5f827/attachment-0003.htm>


More information about the Users mailing list