• Victor Stinner's avatar
    Issue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods · 511491ad
    Victor Stinner yazdı
    of datetime.datetime: microseconds are now rounded to nearest with ties going
    to nearest even integer (ROUND_HALF_EVEN), instead of being rounding towards
    zero (ROUND_DOWN). It's important that these methods use the same rounding
    mode than datetime.timedelta to keep the property:
    
       (datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t)
    
    It also the rounding mode used by round(float) for example.
    
    Add more unit tests on the rounding mode in test_datetime.
    511491ad
Adı
Son kayıt (commit)
Son güncelleme
..
ACKS Loading commit data...
HISTORY Loading commit data...
NEWS Loading commit data...
Porting Loading commit data...
README Loading commit data...
README.AIX Loading commit data...
README.coverity Loading commit data...
README.valgrind Loading commit data...
SpecialBuilds.txt Loading commit data...
coverity_model.c Loading commit data...
gdbinit Loading commit data...
indent.pro Loading commit data...
python-config.in Loading commit data...
python-config.sh.in Loading commit data...
python-wing3.wpr Loading commit data...
python-wing4.wpr Loading commit data...
python-wing5.wpr Loading commit data...
python.man Loading commit data...
python.pc.in Loading commit data...
svnmap.txt Loading commit data...
valgrind-python.supp Loading commit data...
vgrindefs Loading commit data...