Skip to content

mod for arrays #1035

Closed
Closed
@czgdp1807

Description

@czgdp1807

@certik Builtin % in LPython doesn't work on arrays by default because it is implemented as a function and not a binop. So the question is which approach to follow,

  1. To make _mod function defined in lpython_builtin.py vectorised;
  2. Define Mod as binop and then use builder->CreateSRem in LLVM backend. Note that not all backends might support modulus operation on types other than integers.
  3. Define mod and then make it vectorisable.

I think 3rd approach is a good one and complies with Python and NumPy standards. What do you say @certik?

Originally posted by @czgdp1807 in #1002 (comment)

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