Skip to content

bug when dividing two vectors #6

@PierreBlanchart

Description

@PierreBlanchart

Hello,
I have a problem with the following code:

"
final ones = Vector.filled(22, 1);
final K = Vector.fromList(List.generate(22, (index) => index+1.0));
Vector res = ones/K;
print(res.sum());
Vector res_copy = Vector.fromList(res.toList());
print(res_copy.sum());
"

It gives two different results:
"
2.4335824847221375
3.690813660621643
"

For vector of length 20, it's fine. But for 22 it's not. That problem seems to appear when using the divide operation between two vectors.

Best regards

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