Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add methods from the builtin float types to the numpy floating point types #13375

Copy link
Copy link
Open
@eric-wieser

Description

@eric-wieser
Issue body actions

Asking for methods that exist on builtin float types but not numpy types gives:

>>> set(dir(float)) - set(dir(np.float32))
{'__getformat__',
 '__getnewargs__',
 '__setformat__',
 '__trunc__',
 'as_integer_ratio',
 'fromhex',
 'hex',
 'is_integer'}

Filtering these to the ones that are not CPython implementation details, we have:

For all of these, the best approach is probably to port the CPython implementations, taking care to handle the extended precision of long doubles.

Note that we get these methods for free on np.float64 due to inheriting from float

Metadata

Metadata

Assignees

No one assigned

    Labels

    01 - EnhancementProjectPossible project, may require specific skills and long commitmentPossible project, may require specific skills and long commitment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.