RFC: add `exp2` function to the standard

Open
#591 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api, documentation

Research direction

Start by reading the array API specification and the referenced elementwise_functions.py definition for log2, then compare the common_apis.csv entry and linked prior-art implementations. Done means reaching a project decision on whether exp2 belongs in the standard and documenting the accepted API consistently with the existing specification.

Written by the indexing model from the issue text.

Description

API extension RFC

This RFC requests to include a new API in the array API specification for the purpose of computing the base-2 exponential.

Overview

Based on array comparison data, the API is available in the majority of libraries in the PyData ecosystem.

The Array API specification currently includes log2, exp, and pow, but does not include the IEEE 754 function exp2. Would be nice to add for completeness.

While this can currently be achieved now by using pow, exp2 is commonly implemented as a slightly more ergonomic perf path.

Prior art

Proposal:

def exp2(x: array, /) -> array

cc @kgryte

Dominant language
Python
Stars
281
Forks
52
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from data-apis/array-api

All issues in data-apis/array-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.