package J2;

import m1.AbstractC2464a;

/* JADX INFO: loaded from: classes.dex */
public final class E implements Cloneable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final float f3167a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f3168b;

    public E(float f6, int i6) {
        this.f3167a = f6;
        this.f3168b = i6;
    }

    public final float a(B0 b02) {
        float fSqrt;
        if (this.f3168b != 9) {
            return d(b02);
        }
        z0 z0Var = b02.f3156c;
        C0427s c0427s = z0Var.f3494g;
        if (c0427s == null) {
            c0427s = z0Var.f3493f;
        }
        float f6 = this.f3167a;
        if (c0427s == null) {
            return f6;
        }
        float f7 = c0427s.f3446d;
        if (f7 == c0427s.f3447e) {
            fSqrt = f6 * f7;
        } else {
            fSqrt = f6 * ((float) (Math.sqrt((r0 * r0) + (f7 * f7)) / 1.414213562373095d));
        }
        return fSqrt / 100.0f;
    }

    public final float b(B0 b02, float f6) {
        return this.f3168b == 9 ? (this.f3167a * f6) / 100.0f : d(b02);
    }

    public final float c() {
        float f6;
        float f7;
        int iC = AbstractC2464a.c(this.f3168b);
        float f8 = this.f3167a;
        if (iC == 0) {
            return f8;
        }
        if (iC == 3) {
            return f8 * 96.0f;
        }
        if (iC == 4) {
            f6 = f8 * 96.0f;
            f7 = 2.54f;
        } else if (iC == 5) {
            f6 = f8 * 96.0f;
            f7 = 25.4f;
        } else if (iC == 6) {
            f6 = f8 * 96.0f;
            f7 = 72.0f;
        } else {
            if (iC != 7) {
                return f8;
            }
            f6 = f8 * 96.0f;
            f7 = 6.0f;
        }
        return f6 / f7;
    }

    public final float d(B0 b02) {
        float f6;
        float f7;
        int iC = AbstractC2464a.c(this.f3168b);
        float f8 = this.f3167a;
        switch (iC) {
            case 1:
                return b02.f3156c.f3491d.getTextSize() * f8;
            case 2:
                return (b02.f3156c.f3491d.getTextSize() / 2.0f) * f8;
            case 3:
                b02.getClass();
                return f8 * 96.0f;
            case 4:
                b02.getClass();
                f6 = f8 * 96.0f;
                f7 = 2.54f;
                break;
            case 5:
                b02.getClass();
                f6 = f8 * 96.0f;
                f7 = 25.4f;
                break;
            case 6:
                b02.getClass();
                f6 = f8 * 96.0f;
                f7 = 72.0f;
                break;
            case 7:
                b02.getClass();
                f6 = f8 * 96.0f;
                f7 = 6.0f;
                break;
            case 8:
                z0 z0Var = b02.f3156c;
                C0427s c0427s = z0Var.f3494g;
                if (c0427s == null) {
                    c0427s = z0Var.f3493f;
                }
                if (c0427s != null) {
                    f6 = f8 * c0427s.f3446d;
                    f7 = 100.0f;
                    break;
                }
            default:
                return f8;
        }
        return f6 / f7;
    }

    public final float e(B0 b02) {
        if (this.f3168b != 9) {
            return d(b02);
        }
        z0 z0Var = b02.f3156c;
        C0427s c0427s = z0Var.f3494g;
        if (c0427s == null) {
            c0427s = z0Var.f3493f;
        }
        float f6 = this.f3167a;
        return c0427s == null ? f6 : (f6 * c0427s.f3447e) / 100.0f;
    }

    public final boolean f() {
        return this.f3167a < 0.0f;
    }

    public final boolean h() {
        return this.f3167a == 0.0f;
    }

    public final String toString() {
        String str;
        StringBuilder sb = new StringBuilder();
        sb.append(String.valueOf(this.f3167a));
        switch (this.f3168b) {
            case 1:
                str = "px";
                break;
            case 2:
                str = "em";
                break;
            case 3:
                str = "ex";
                break;
            case 4:
                str = "in";
                break;
            case 5:
                str = "cm";
                break;
            case 6:
                str = "mm";
                break;
            case 7:
                str = "pt";
                break;
            case 8:
                str = "pc";
                break;
            case 9:
                str = "percent";
                break;
            default:
                str = "null";
                break;
        }
        sb.append(str);
        return sb.toString();
    }

    public E(float f6) {
        this.f3167a = f6;
        this.f3168b = 1;
    }
}
