Commit 6917b4c
authored
os: ns_to_sec rounding (RustPython#5150)
In cpython, they use `_PyTime_ROUND_FLOOR` to read time.
But in RustPython, we use `[Duration::from_secs_f64](https://doc.rust-lang.org/std/time/struct.Duration.html#method.try_from_secs_f64)` to read time.
Therefore, RustPython isn't affected by the rounding issue in the way
that cpython does. We can safely ignore the `0.5*1e-9` bit in
`ns_to_sec` function.1 parent aaae566 commit 6917b4c
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
819 | 821 | | |
820 | | - | |
821 | | - | |
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
833 | | - | |
834 | | - | |
835 | 833 | | |
836 | 834 | | |
837 | 835 | | |
| |||
0 commit comments