Skip to content

Bug in util/ArrayUtils.java clip #534

@angers2807

Description

@angers2807

public static double[] clip(double[] values, double min, double max) { for (int i = 0; i < values.length; i++) { values[i] = Math.min(1, Math.max(0, values[i])); } return values; }
Doesn't ever reference the min and max parameters, instead it always clips to 0,1
This doesn't currently cause a problem because the only usages (in SpatialPooler) call it with params that currently happen to be 0,1 (c.getSynPermMin(), c.getSynPermMax())
However this is a bug just waiting to happen

Sorry, I'm not setup to make contributions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions