No description
Since CircuitPython floats have very small precision, the "total_seconds" method was not very useful for large timedeltas. Instead of always returning a float, use pure-integer arithmetic (and return an int) if either: * the length of time is big (1<<21 is 2097152 seconds or about 24 days) * the number of microseconds is zero Otherwise, for small values with nonzero microseconds, use floating-point math. The cut-off point was chosen because in CircuitPython float arithmetic, 2097151.0+0.5 is different from 2097151.0, but 2097152.0+0.5 and 2097152.0 are *the same float*. |
||
|---|---|---|
| .github/workflows | ||
| docs | ||
| examples | ||
| LICENSES | ||
| tests | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .pylintrc | ||
| .readthedocs.yml | ||
| adafruit_datetime.py | ||
| CODE_OF_CONDUCT.md | ||
| LICENSE | ||
| pyproject.toml | ||
| README.rst | ||
| README.rst.license | ||
| requirements.txt | ||
| setup.py | ||
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries SPDX-License-Identifier: MIT