Skip to content

Conversation

@DeVikingMark
Copy link

@DeVikingMark DeVikingMark commented Dec 5, 2025

Description

Replaces math.Pow calls with exact integer constants and bit shifts to avoid potential floating-point precision issues when computing powers of 2.

Changes

  • Replace math.Pow(2, 32) with constant 4294967296 in NewF() (line 80)
  • Replace math.Pow(2, 27) with constant 134217728 in reduceWithMaxBits() (line 390)
  • Replace math.Pow(2, 27) with bit shift big.NewInt(1).Lsh(big.NewInt(1), 27) in SplitLimbsHint() (line 465)

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.

1 participant