CICFlowMeter icon indicating copy to clipboard operation
CICFlowMeter copied to clipboard

Down/up ratio calculation incorrect

Open lisa-lthorrold opened this issue 3 years ago • 1 comments

if(this.forward.size() > 0){ return (double)(this.backward.size()/this.forward.size()); } return 0; }

This is casting the result of an integer division (int/int) [which returns an int] to a float, rather than correctly casting the numerator to force a double to ensure a proper division. The result is that the down/up ratio is always 0 or 1, which I think is unintended (based on the return type).

lisa-lthorrold avatar Oct 24 '21 10:10 lisa-lthorrold

If you still pay attention to this project, welcome to refer to my forked repository:

https://github.com/blueice-thu/CICFlowMeter.

Your issue has been resolved in my repository. I will improve the project and resolve as many issues as possible recently. Welcome for suggestions. :)

yorhaha avatar Apr 08 '22 23:04 yorhaha