Message160039
| Author |
skrah |
| Recipients |
mark.dickinson, serhiy.storchaka, skrah |
| Date |
2012年05月05日.20:25:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1336249539.16.0.910746617763.issue14722@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The proposal makes sense at first glance, but I agree with Mark that it is
not clear what should be done. For example, all arrays in Python silently
convert to inf:
>>> from numpy import array
>>> x = array([1,2,3], 'f')
>>> x
array([ 1., 2., 3.], dtype=float32)
>>> x[0] = 10**100
>>> x
array([ inf, 2., 3.], dtype=float32)
Same for array.array and memoryview. I would not be surprised if users rely
on this behavior. Anyway, silently converting to infinity is exactly what
I'd expect (also for double BTW).
Regarding undefined behavior: I only know compilers that convert to infinity
without signaling overflow. The tests for the new memoryview implementation
should include this case (I think!), and I ran the tests with all compilers
that I've access to. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年05月05日 20:25:39 | skrah | set | recipients:
+ skrah, mark.dickinson, serhiy.storchaka |
| 2012年05月05日 20:25:39 | skrah | set | messageid: <1336249539.16.0.910746617763.issue14722@psf.upfronthosting.co.za> |
| 2012年05月05日 20:25:38 | skrah | link | issue14722 messages |
| 2012年05月05日 20:25:38 | skrah | create |
|