8000 NumericalProperty broken with doubles · Issue #2 · lhogie/grph · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
NumericalProperty broken with doubles #2
Open
@tmpsantos

Description

@tmpsantos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0