Skip to content

generate_ticks needs rewrite - problem with tiny values #42

Closed
@Ploppz

Description

@Ploppz

I had a problem when trying to save a figure, that generate_ticks(..) in src/axis.rs ran indefinitely (or until overflow happened in debug mode), with input min:-0.8230515814500334, max:-0.8230515813631452, step_size:0.00000000002.

The problem is obviously that it starts at 0.0 and counts up 0.00000000002 at a time so that for example after 5 million iterations it is only at -0.0001.

One solution could be to not start counting from 0.0, but rather from min rounded to the nearest step_size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions