-
Notifications
You must be signed in to change notification settings - Fork 278
Strengthen field division warning in assembly docs #2911
Description
The field operations page already notes that "the result of divisions may appear counter-intuitive because divisions are defined via inversions", and the math formula correctly shows a * b^{-1} mod p. The code_organization.md page also distinguishes / (field division) from // (integer division) for constant expressions.
However, the warning is easy to miss, and there is no cross-reference between the field operations div and the u32 operations u32div making it explicit that these are fundamentally different operations. Developers coming from other ecosystems expect / to be floor division, and the current documentation relies on them reading the math formula carefully.
I think it would be helpful to make the existing warning more prominent and add a short note like "For integer floor division, use u32div" directly on the div instruction entry. A cross-reference between the two pages would go a long way.