justcoding121 / advanced-algorithms

100+ algorithms & data structures generically implemented in C#
MIT License
1.31k stars 290 forks source link

Fix V3041, V3064 warnings from PVS-Studio Static Analyzer #3

Closed AdmAlexus closed 7 years ago

AdmAlexus commented 7 years ago

Hello. I'm a member of the Pinguem.ru competition on finding errors in open source projects. A bug, found using PVS-Studio.

About your warnings: V3041, V3064.

Warnings with High priority:

V3041 The expression was implicitly cast from 'int' type to 'double' type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) / Y;. KnackSackProblems.cs 63

Warnings with Low priority:

V3064 Potential division by zero. Consider inspecting denominator 'bucketSize'. BucketSort.cs 31