Skip to content

math.powi returns i64, may need cast for int contexts #43

@ylluminate

Description

@ylluminate

math.powi(a, b) returns i64, but Python integer variables map to V's int. This usually works fine since V handles int/i64 interop, but could cause type errors in explicitly typed code.

x: int = 2 ** 10
x := math.powi(2, 10)  // x is i64, not int

Could wrap with int() when the target is known to be int, but probably not worth the noise for most code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions