Skip to content

Add a bits attribute to np.finfo() (Trac #1288) #1886

Closed

Description

@thouis

Original ticket http://projects.scipy.org/numpy/ticket/1288 on 2009-11-06 by @astrofrog, assigned to unknown.

The number of bits occupied by an integer type can be found from:

In [6]: np.iinfo(np.int16).bits

Out[6]: 16

but this is not currently possible for floats:

In [7]: np.finfo(np.float32).bits

AttributeError Traceback (most recent call
last)

/Users/tom/ in ()

AttributeError: 'finfo' object has no attribute 'bits'

Would it be possible to implement this?

Activity

  1. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    Milestone changed to Unscheduled by @cournape on 2009-11-27

  2. charris commented on Feb 18, 2014

    @charris
    Member

    Sounds reasonable.

  3. added a commit that references this issue on Jun 4, 2016
    3071778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions