Kotlin / Kotlin/multik

any plan to add `power` function like numpy?

Open
#162 5 comments 2 reactions 0 assignees View on GitHub
api engine-native feature
Dominant language
Kotlin
Stars
734
Forks
51
Avg merge
9h 52m
Merged PRs (30d)
6

Description

I'd like to hava a `power` function just like numpy.

Behavoirs:

case 1:
> array [1, 2, 3, 4, 5] power number 2 returns [1, 4, 9, 16, 25]

case 2:
> array [1, 2, 3, 4, 5] power array [1, 1, 2, 2, 1] returns [1, 2, 9, 16, 5]

case 3:
> array [1, 2, 3, 4, 5] power array of [[1, 1, 2, 2, 1], [2, 2, 1, 1, 2]] returns [[1, 2, 9, 16, 5], [1, 4, 3, 4, 25]]

Guys, do you have any plan for this one? Or it is just a not such reasonable case for library design. Or there is already one simliar function with different name.

Thx.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by reviewing the existing multidimensional-array operations and their tests, then determine where a NumPy-like power API belongs and how the three scalar, vector, and nested-array cases should be specified and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.