MCPcopy Create free account
hub / github.com/numpy/numpy / iinfo

Class iinfo

numpy/core/getlimits.py:631–735  ·  view source on GitHub ↗

iinfo(type) Machine limits for integer types. Attributes ---------- bits : int The number of bits occupied by the type. dtype : dtype Returns the dtype for which `iinfo` returns information. min : int The smallest integer expressible by the type

Source from the content-addressed store, hash-verified

629
630@set_module('numpy')
631class iinfo:
632 """
633 iinfo(type)
634
635 Machine limits for integer types.
636
637 Attributes
638 ----------
639 bits : int
640 The number of bits occupied by the type.
641 dtype : dtype
642 Returns the dtype for which `iinfo` returns information.
643 min : int
644 The smallest integer expressible by the type.
645 max : int
646 The largest integer expressible by the type.
647
648 Parameters
649 ----------
650 int_type : integer type, dtype, or instance
651 The kind of integer data type to get information about.
652
653 See Also
654 --------
655 finfo : The equivalent for floating point data types.
656
657 Examples
658 --------
659 With types:
660
661 >>> ii16 = np.iinfo(np.int16)
662 >>> ii16.min
663 -32768
664 >>> ii16.max
665 32767
666 >>> ii32 = np.iinfo(np.int32)
667 >>> ii32.min
668 -2147483648
669 >>> ii32.max
670 2147483647
671
672 With instances:
673
674 >>> ii32 = np.iinfo(np.int32(10))
675 >>> ii32.min
676 -2147483648
677 >>> ii32.max
678 2147483647
679
680 """
681
682 _min_vals = {}
683 _max_vals = {}
684
685 def __init__(self, int_type):
686 try:
687 self.dtype = numeric.dtype(int_type)
688 except TypeError:

Callers 4

test_basicMethod · 0.90
test_unsigned_maxMethod · 0.90
test_instancesFunction · 0.90
twodim_base.pyFile · 0.90

Calls

no outgoing calls

Tested by 3

test_basicMethod · 0.72
test_unsigned_maxMethod · 0.72
test_instancesFunction · 0.72