add a reference to the math.ceil note
This commit is contained in:
1 parent
d01659d614
commit
edd25afad3
1 file changed
+3
-2
+3
-2
@@ -354,8 +354,9 @@ class bondmaker:
|
|||||||
#print('z range: [%6.2f;%6.2f] %6.2f'%(zmin,zmax,zlen))
|
#print('z range: [%6.2f;%6.2f] %6.2f'%(zmin,zmax,zlen))
|
||||||
|
|
||||||
# how many boxes do we need in each dimension?
|
# how many boxes do we need in each dimension?
|
||||||
# NOTE: math.ceil() returns an int in python3 and a float in python2,
|
# NOTE: math.ceil() returns an int in python3 and a float in
|
||||||
# so we need to cast it to int for range() to work.
|
# python2, so we need to convert it to an int for range() to work in
|
||||||
|
# both versions. See PEP 3141.
|
||||||
self.no_box_x = max(1, int(math.ceil(xlen/box_size)))
|
self.no_box_x = max(1, int(math.ceil(xlen/box_size)))
|
||||||
self.no_box_y = max(1, int(math.ceil(ylen/box_size)))
|
self.no_box_y = max(1, int(math.ceil(ylen/box_size)))
|
||||||
self.no_box_z = max(1, int(math.ceil(zlen/box_size)))
|
self.no_box_z = max(1, int(math.ceil(zlen/box_size)))
|
||||||
|
|||||||
Reference in new issue
Block a user