How does FunC round numbers while dividing?
How does FunC round numbers while dividing?
There are different approaches to division:
* using floating-point numbers (so 23 / 4 = 5.75)
* mathematical rounding (23 / 4 = 6 since it's the closest integer to 5.75)
* floor-rounding (23 / 4 = 5, the number gets rounded to the "closest smaller" integer and everything after the dot just gets truncated)
* ceiling rounding (23 / 4 = 6, the number gets rounded to the "bigger" side)
* saving both the quotient and the remainder as two separate numbers (23 / 4 = 5 and 3)
What is the FunC approach?
---
> This question was imported from Telegram Chat: https://t.me/tondev/125289
There are different approaches to division:
using floating-point numbers (so 23 / 4 = 5.75)
mathematical rounding (23 / 4 = 6 since it's the closest integer to 5.75)
floor-rounding (23 / 4 = 5, the number gets rounded to the "closest smaller" integer and everything after the dot just gets truncated)
ceiling rounding (23 / 4 = 6, the number gets rounded to the "bigger" side)
saving both the quotient and the remainder as two separate numbers (23 / 4 = 5 and 3)
What is the FunC approach?
---
> This question was imported from Telegram Chat: https://t.me/tondev/125289
#func
How does FunC round numbers while dividing?
There are different approaches to division:
using floating-point numbers (so 23 / 4 = 5.75)
mathematical rounding (23 / 4 = 6 since it's the closest integer to 5.75)
floor-rounding (23 / 4 = 5, the number gets rounded to the "closest smaller" integer and everything after the dot just gets truncated)
ceiling rounding (23 / 4 = 6, the number gets rounded to the "bigger" side)
saving both the quotient and the remainder as two separate numbers (23 / 4 = 5 and 3)
What is the FunC approach?
---
> This question was imported from Telegram Chat: https://t.me/tondev/125289