Skip to content

Float comparison issues with time and quantity #6970

Description

@bsipocz

The following snippet returns True with astropy 2.0.2, but False on master and 2.0.x (2.0.3.dev19469)

>>> import astropy
>>> print(astropy.__version__)
>>> from astropy.time import Time
>>> import astropy.units as u
>>> start = Time('2016-02-06 03:00:00')
>>> duration = 2*u.hour
>>> end_time = start + duration
>>> end_time - duration == start
2.0.2
True
>>> import astropy
>>> print(astropy.__version__)
>>> from astropy.time import Time
>>> import astropy.units as u
>>> start = Time('2016-02-06 03:00:00')
>>> duration = 2*u.hour
>>> end_time = start + duration
>>> print(end_time - duration == start)
>>> print(end_time - duration)
>>> print(start)
3.0.dev20874
False
2016-02-06 03:00:00.000
2016-02-06 03:00:00.000

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions