Rounding Function #10

Closed
opened 2025-08-27 14:42:43 +10:00 by DiamondNether90 · 1 comment

This one is pretty self explanatory - the ability to round doubles would be extremely useful for computation.
round $double &int: Rounds a double to the nearest integer.
floor $double &int: Rounds a double down to the nearest integer.
ceiling $double &int: Rounds a double up to the nearest integer.
mod $double $double &double: Finds the first input modulo the second input. Easiest way to understand this is a clock: a clock works modulo 12. \text{mod}(15,12)=3, \text{mod}(23,12)=11, \text{mod}(-2,12)=10.

This one is pretty self explanatory - the ability to round doubles would be extremely useful for computation. `round $double &int`: Rounds a double to the nearest integer. `floor $double &int`: Rounds a double down to the nearest integer. `ceiling $double &int`: Rounds a double up to the nearest integer. `mod $double $double &double`: Finds the first input modulo the second input. Easiest way to understand this is a clock: a clock works modulo 12. $\text{mod}(15,12)=3$, $\text{mod}(23,12)=11$, $\text{mod}(-2,12)=10$.
Owner

Added in the latest math library. If you could try it out and make sure it works that would be good

Added in the latest math library. If you could try it out and make sure it works that would be good
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ground/ground#10
No description provided.