LSSTApplications
12.15gbdcc3ab+2,15.0+13,15.0+26,15.01g19261fa+17,15.01g60afb23+26,15.01g615e0bb+18,15.01g788a293+26,15.01ga91101e+26,15.01gae1598d+12,15.01gd076f1f+24,15.01gdf18595+5,15.01gf4f1c34+12,15.011g7db6e543+4,15.012g3681e7a+4,15.015gc15de322,15.016g83b84f4,15.02g100d730+19,15.02g1f9c9cf+4,15.02g8aea5f4+1,15.02gf38729e+21,15.029ga12a2b06e,15.03g11fe1a0+14,15.03g707930d+3,15.03g9103c06+12,15.03gd3cbb57+3,15.04g2d82b59,15.04g535e784+10,15.04g92ca6c3+4,15.04gf906033+2,15.05g23e394c+14,15.05g4be42a9,15.06g69628aa,15.06g86e3f3d+1,15.06gfa9b38f+4,15.07g949993c+3,15.08g67a62d3+1,15.08gcf05001+1,15.09g1e7c341+1,w.2018.21
LSSTDataManagementBasePackage

The Point and Extent classes support many mathematical operators, but the set of available operators (and their expected behavior) isn't quite as obvious as one might think.
The table below lists all supported operators, with notes below on special cases. For the rationale behind these operations, see RFC41.
LHS  RHS  Operator  Result  Notes 

PointD  PointD  +, +=  Not supported  (1) 
PointD  PointI  +, +=  Not supported  (1) 
PointD  PointD    ExtentD  
PointD  PointD  =  Not supported  (2) 
PointD  PointI    ExtentD  
PointD  PointI  =  Not supported  (2) 
PointD  ExtentD  +, +=, , =  PointD  
PointD  ExtentI  +, +=, , =  PointD  
PointI  PointD  +, +=  Not supported  (1) 
PointI  PointI  +, +=  Not supported  (1) 
PointI  ExtentD  +  PointD  
PointI  ExtentD  +=  Not supported  (2) 
PointI  ExtentI  +, +=  PointI  
PointI  PointD    ExtentD  
PointI  PointD  =  Not supported  (2) 
PointI  PointI    ExtentI  
PointI  PointI  =  Not supported  (2) 
PointI  ExtentD    PointD  
PointI  ExtentD  =  Not supported  (2) 
PointI  ExtentI  , =  PointI  
ExtentD  PointD  +  PointD  
ExtentD  PointD  +=  Not supported  (2) 
ExtentD  PointD  , =  Not supported  (1) 
ExtentD  PointI  +  PointD  
ExtentD  PointI  +=  Not supported  (2) 
ExtentD  PointI  , =  Not supported  (1) 
ExtentD  ExtentD  +, +=, , =  ExtentD  
ExtentD  ExtentI  +, +=, , =  ExtentD  
ExtentI  PointD  +  PointD  
ExtentI  PointD  +=  Not supported  (2) 
ExtentI  PointD  , =  Not supported  (1) 
ExtentI  PointI  +  PointI  
ExtentI  PointI  +=  Not supported  (2) 
ExtentI  PointI  , =  Not supported  (1) 
ExtentI  ExtentD  +,   ExtentD  
ExtentI  ExtentD  +=, =  Not supported  (2) 
ExtentI  ExtentI  +, , +=, =  ExtentI  
ExtentD  double  *, *=, /, /=  ExtentD  
ExtentD  double  //, //=  Not supported  (5) 
ExtentD  int  *, *=, /, /=  ExtentD  (3) 
ExtentD  int  //, //=  Not supported  (5) 
ExtentI  double  *  ExtentD  
ExtentI  double  *=  Not supported  (2) 
ExtentI  double  /  ExtentD  (4) 
ExtentI  double  /=  Not supported  (2), (4) 
ExtentI  double  //, //=  Not supported  (5) 
ExtentI  int  *, *=  ExtentI  
ExtentI  int  /  ExtentD  (4) 
ExtentI  int  /=  Not supported (Python), ExtentI (C++)  (2), (4) 
ExtentI  int  //, //=  ExtentI  (6) 
double  ExtentD  *  ExtentD  
double  ExtentI  *  ExtentD  
int  ExtentD  *  ExtentD  (3) 
int  ExtentI  *  ExtentI 
double
will also accept int
(but may yield different answers for extremely large integers that cannot be represented exactly as double
s).from __future__ import division
. If this is not enabled, the behavior of the "/" operator will be that of "//", and likewise for "/=" and "//=", for all operations with ExtentI
on the LHS.//
operator applies only to integer types.a//b
is equivalent to floor(a/b)
, while C++ specifies that it should be equivalent to int(a/b)
. Note that floor
rounds negative numbers down and int
rounds them up.