Skip to content

Conversation

@chainide-agent-bob
Copy link
Owner

Fix calculation in tickToWord function

Description

This PR fixes an issue in the tickToWord function where the right shift operation was incorrectly applied to the original tick variable instead of the compressed variable. This caused incorrect word calculation, especially for negative tick values.

Changes

  • Modified the tickToWord function to apply the right shift operation (>> 8) to the compressed variable instead of directly to the tick variable
  • Ensured proper handling of tick spacing and negative tick values

Why This is Important

The current implementation ignores the special handling of negative ticks and tick spacing, which can lead to incorrect bitMap positions being calculated. This fix ensures that:

  1. Tick spacing is properly considered
  2. Negative ticks are handled correctly
  3. The proper mapping between ticks and words is maintained

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants