(float-round) ( x round-quot -- y )


Vocabulary
math.functions

Inputs
xan object
round-quotan object


Outputs
yan object


Definition


: (float-round) ( x round-quot -- y )
[ dup 1 mod [ - ] keep dup swapd abs 0.5 ] [ call ] bi*
[ swap 0.0 < -1.0 1.0 ? + ] [ nip ] if ; inline