erlsci / iso8601

An ISO 8601 date formating and parsing library for Erlang
MIT License
130 stars 93 forks source link

Microsecond precision #7

Open seansawyer opened 12 years ago

seansawyer commented 12 years ago

This will need to be a major version bump, since the time() type will have to change to accomodate microseconds.

Tyra-Bjurman commented 9 years ago

I would love to see some microseconds included someday.

oubiwann commented 8 years ago

PR #16 adds support for this using parse_exact (in order to not break the API).

It currently needs to be rebased and then have some unit tests added ...

aseigo commented 8 years ago

PR #31 was merged that was an improved version of PR #16, so this could now be closed?

KrzysiekJ commented 6 years ago

Using floats is scary when speaking about high precision.

1> 1 - 0.9.
0.09999999999999998
2> 1.1 - 1.
0.10000000000000009

Does the current implementation of parse_exact/1 guarantee to be safe in regard to rounding? For example, if seconds are written as 01.234500000, then if I extract miliseconds as round((SecsFloat - trunc(SecsFloat)) * 1000), will it always yield 235?