Message225365
| Author |
eryksun |
| Recipients |
eryksun, mark.dickinson, rhettinger, skrah, steven.daprano, tim.peters |
| Date |
2014年08月15日.21:20:28 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1408137628.18.0.381004209421.issue22198@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
decimal.Decimal 'floor division' is integer division that truncates toward 0 (see 9.4.2).
>>> Decimal('-0.5').__floor__()
-1
>>> Decimal('-0.5').__floordiv__(1)
Decimal('-0')
Numpy 1.8.1:
>>> np.float32(-0.5) // 1
-1.0
>>> np.float32(-0.5) // float('inf')
-0.0
>>> np.array([-0.5]) // 1
array([-1.])
>>> np.array([-0.5]) // float('inf')
array([-0.]) |
|