/**
 * Positive number produce 1, negative -1 and 0 produces 0.
 *
 * Standard implementation in graphics languages such as HLSL and GLSL
 *
 * @param {number} v
 * @returns {number} +1 if `v > 0`, 0 if `v == 0`, -1 if `v < 0`
 */
export function sign(v) {
    return v > 0 ? 1 : (v < 0 ? -1 : 0);
}
