/* QUANTIZATION OF FLOATING-POINT VALUES */ int32_t stmesh_utils_round(float x, float eps, int32_t r); /* Rounds the ratio {x/eps} to an integer. If {r} is negative, rounds to the nearest integer. If {r} non-negative, rounds to the nearest integer that congruent to {r} modulo {2}. In case of ties, rounds {x/eps} to the nearest even number if {r < 0}, and to the nearest integer of the form {4*k + r} if {r} is 0 or 1. */