public extern round(x: float64) -> int64;
public extern random(min: int64, max: int64) -> int64;

public fun abs(x: int64) -> int64 {
    if x < 0 {
        return -x;
    }
    return x;
}

public fun abs_f(x: float64) -> float64 {
    if x < 0.0 {
        return -x;
    }
    return x;
}

public fun min(x: int64, y: int64) -> int64 {
    if x < y {
        return x;
    }
    return y;
}
public fun min_f(x: float64, y: float64) -> float64 {
    if x < y {
        return x;
    }
    return y;
}

public fun max(x: int64, y: int64) -> int64 {
    if x > y {
        return x;
    }
    return y;
}

public fun max_f(x: float64, y: float64) -> float64 {
    if x > y {
        return x;
    }
    return y;
}

public fun pow(x: int64, y: int64) -> int64 {
    let result: int64 = 1;
    while y > 0 {
        result = result * x;
        y = y - 1;
    }
    return result;
}
public fun pow_f(x: float64, y: int64) -> float64 {
    let result: float64 = 1.0;
    while y > 0 {
        result = result * x;
        y = y - 1;
    }
    return result;
}
