micropython-ulab/tests/2d/numpy/zeros.py.exp
Jeff Epler 315c988393
Check that array size doesn't overflow at construction time
Now, requesting to allocate an array that is too big gives the exception
'array is too big', like numpy.

This does depend on a gcc extension, `__builtin_mul_overflow`, present
since at least version 5. This extension is also supported in clang.
msvc is probably the only compiler of note that does not support it.

Closes: #576
2023-01-19 07:15:58 -06:00

42 lines
907 B
Text

array([0.0, 0.0, 0.0], dtype=float64)
array([[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]], dtype=float64)
array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]], dtype=uint8)
array([[0, 0],
[0, 0],
[0, 0],
[0, 0]], dtype=uint8)
array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]], dtype=int8)
array([[0, 0],
[0, 0],
[0, 0],
[0, 0]], dtype=int8)
array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]], dtype=uint16)
array([[0, 0],
[0, 0],
[0, 0],
[0, 0]], dtype=uint16)
array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]], dtype=int16)
array([[0, 0],
[0, 0],
[0, 0],
[0, 0]], dtype=int16)
array([[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]], dtype=float64)
array([[0.0, 0.0],
[0.0, 0.0],
[0.0, 0.0],
[0.0, 0.0]], dtype=float64)
ValueError
ValueError
ValueError