Skip to content

Should we use 64 bit float to represent event weights, instead of 32 bit? #349

Open
@SimonHeybrock

Description

@SimonHeybrock

scn.load and scn.load_nexus currently use float32 to repsent the event weights. These all default to 1.0 so this is fine. However, when summing events later the user may encounter a surprising precision loss.

We should carefully consider the tradeoff between risk for bugs and memory use. Reduction operations use double precision for intermediate values so many problems are avoided. Nevertheless final results can be affected significantly. For example:

import numpy as np
np.float32(75893996)

gives 75894000.

Activity

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

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