wavebitscientific / datetime-fortran

Date and time manipulation for modern Fortran
MIT License
137 stars 51 forks source link

Division by zero in datetime%utc() #5

Closed milancurcic closed 11 years ago

milancurcic commented 11 years ago

Reported and fixed by Bjoern Hendrik Fock of University of Hamburg.

Problem: Calling datetime%utc() with a datetime instance that is already in UTC timezone (i.e. datetime%tz = 0) resulted in a division by zero.

Solution: Replacing the problematic line that uses division with a line that uses the intrinsic SIGN() function solves the problem.