/**
 *
 * @param {*} ctor
 * @returns {number}
 */
export function saturated_value_by_constructor(ctor) {

    switch (ctor) {
        case Uint8Array:
            return 255;
        case Uint16Array:
            return 65535;
        case Uint32Array:
            return 4294967295;
        case Int8Array:
            return 127;
        case Int16Array:
            return 32767;
        case Int32Array:
            return 2147483647;
        case Float32Array:
        case Float64Array:
            return 1;
        default:
            return 1;
    }

}
