Skip to content

Add real-valued (double) temperature types#3

Merged
cleishm merged 1 commit into
mainfrom
feat/real-valued-temperatures
Jul 6, 2026
Merged

Add real-valued (double) temperature types#3
cleishm merged 1 commit into
mainfrom
feat/real-valued-temperatures

Conversation

@cleishm

@cleishm cleishm commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Add real-valued double-precision temperature types — celsius_real, kelvin_real, and fahrenheit_real — whose count() reads directly in scale degrees. Their std::formatter specializations render the degree value with the scale suffix (22.5°C) and honor the standard floating-point format spec ({:.1f}22.5°C). The intended use is to cast an exact reading to a real-valued type for display or floating-point computation, e.g. temperature_cast<celsius_real>(millicelsius(22500)).

Also include <version> before the std::format feature-test check, so the formatter block is enabled in standalone (non-IDF) builds where nothing pulls in __cpp_lib_format first.

Version 1.3.0.

Add celsius_real, kelvin_real, and fahrenheit_real: double-precision
temperatures whose count() reads directly in scale degrees. Their
std::formatter specializations render the degree value with the scale
suffix (e.g. "22.5°C") and honor the standard floating-point format spec
("{:.1f}" -> "22.5°C"). Convert an exact reading with a cast, e.g.
temperature_cast<celsius_real>(millicelsius(22500)).

Include <version> before the std::format feature-test check so the
formatter block is enabled in standalone (non-IDF) builds, where nothing
pulls in __cpp_lib_format beforehand.
@cleishm cleishm force-pushed the feat/real-valued-temperatures branch from 5914892 to 0873647 Compare July 5, 2026 23:55
@cleishm cleishm merged commit da86f09 into main Jul 6, 2026
6 checks passed
@cleishm cleishm deleted the feat/real-valued-temperatures branch July 6, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant