need to truncate towards zero
convert to Python 3