IEEE 754 Rounding

Hello,I’m looking for a way to “round half to even” as done in IEEE 754:0.5 -> 01.5 -> 22.5 -> 23.5 -> 4..Any easy way to do this in Q or do I need to link to a C function?Thanks,Josh

f:{signum*@[foo;where (foo:abs “i”$x) mod 2;-[;1i]]} 

f 0.5 1.5 2.5 3.5 -0.5 -1.5 -2.5 -3.5
0 2 2 4 0 -2 -2 -4i

f enlist 0.5

0

HTH,

Sean

g:{(“j”$x)-(.5=absmod 2)*signum x}