Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumericalProperty broken with doubles #2

Open
tmpsantos opened this issue Sep 5, 2017 · 0 comments
Open

NumericalProperty broken with doubles #2

tmpsantos opened this issue Sep 5, 2017 · 0 comments

Comments

@tmpsantos
Copy link

I might be doing something wrong, but seems to me that NumericalProperty is broken when retrieving numbers as double.

NumericalProperty p = new NumericalProperty("weight");
p.setValue(0, 10);

System.out.println(p.getValueAsDouble(0)); // 4.9E-323
System.out.println(p.getValueAsInt(0)); // 10

The side effect here is that I cannot use Graph.getNeighborsAtMaxDistance because it is using getValueAsDouble internally, so the comparison with maxDistance is always true.

I tested with 1.10.8 which is described on the website as the latest release. I also found a version 4.0.0 which uses long instead of int, but the bug is there too.

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

No branches or pull requests

1 participant