Skip to content

Use floats rather than ints when computing percentA() and percentB()#16

Closed
erikmd wants to merge 1 commit intojplag:masterfrom
erikmd:fix-rounding
Closed

Use floats rather than ints when computing percentA() and percentB()#16
erikmd wants to merge 1 commit intojplag:masterfrom
erikmd:fix-rounding

Conversation

@erikmd
Copy link
Contributor

@erikmd erikmd commented Apr 28, 2016

Hello

I recently noticed the following detail in the generated files results/match*.html: the two percentages that appear in the top right-hand side are always truncated to the nearest integer, so that the percentage in the top left-hand side (average similarity) does not seem to correspond to the average.

Here is a screenshot that shows the issue.
jplag_fix-rounding_before

This seems to be related to the functions percentA() and percentB() in jplag/AllMatches.java
that should probably compute using floats rather than ints.

Here is another screenshot that shows the same example, if one applies the enclosed patch.
jplag_fix-rounding_now

Kind regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments