function performOperation(op: FloatOps, a: number, b: number): FloatResult {
    switch (op) {
        case FloatOps.Add:
            return a + b;
        case FloatOps.Subtract:
            return a - b;
        case FloatOps.Multiply:
            return a * b;
        case FloatOps.Divide:
            return b !== 0 ? a / b : "Infinity";
        case FloatOps.Modulus:
            return b !== 0 ? a % b : "NaN";
        case FloatOps.Power:
            return Math.pow(a, b);
        default:
            throw new Error("Unsupported operation");
    }
}