calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Cleanup the float/int distinction

Open Drup opened this issue 6 years ago • 4 comments

There is currently Calendar, Calendar.Precise, FCalendar and FCalendar.Precise, all with various float/int combination. The tradeoffs are absolutely not explained in the documentation, and I'm quite sure they don't apply anymore, in these times of ubiquitous 64bit systems. We should be able to clean all that up.

Drup avatar Mar 19 '19 23:03 Drup

I was wondering about this too...

loxs avatar Mar 20 '19 06:03 loxs

The precise versions are still useful and are not related to 64-bit systems.

In "standard" implementations (Calendar and FCalendar), a calendar is simply represented by a float. It may lead to approximation due to floating-point rounding.

In "precise" implementations (*.Precise), the "date" part is not represented by a float but by an integer, so it remains precise. However, it is more memory-expensive.

If you'd like to remove some of these implementations, I would suggest not to remove the precise version.

signoles avatar Mar 20 '19 13:03 signoles

@signoles What I had in mind was actually to make the precise version the default. ;)

Drup avatar Mar 20 '19 13:03 Drup

then it makes sense

signoles avatar Mar 20 '19 13:03 signoles