Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✏️ Fix Spelling of Temperature Units #10

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions include/units/Temperature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ constexpr Temperature operator""_kelvin(long double value) { return Temperature(

constexpr Temperature operator""_kelvin(unsigned long long value) { return Temperature(static_cast<double>(value)); }

constexpr Temperature operator""_celcius(long double value) { return Temperature(static_cast<double>(value) + 273.15); }
constexpr Temperature operator""_celsius(long double value) { return Temperature(static_cast<double>(value) + 273.15); }

constexpr Temperature operator""_celcius(unsigned long long value) {
constexpr Temperature operator""_celsius(unsigned long long value) {
return Temperature(static_cast<double>(value) + 273.15);
}

constexpr Temperature operator""_farenheight(long double value) {
constexpr Temperature operator""_fahrenheit(long double value) {
return Temperature((static_cast<double>(value) - 32) * (5.0 / 9.0) + 273.5);
}

constexpr Temperature operator""_farenheight(unsigned long long value) {
constexpr Temperature operator""_fahrenheit(unsigned long long value) {
return Temperature((static_cast<double>(value) - 32) * (5.0 / 9.0) + 273.5);
}

Expand All @@ -31,12 +31,12 @@ constexpr inline Temperature from_kelvin(double value) { return Temperature(valu

constexpr inline double to_kelvin(Temperature quantity) { return quantity.val(); }

constexpr inline Temperature from_celcius(double value) { return Temperature(value + 273.15); }
constexpr inline Temperature from_celsius(double value) { return Temperature(value + 273.15); }

constexpr inline double to_celcius(Temperature quantity) { return quantity.val() - 273.15; }
constexpr inline double to_celsius(Temperature quantity) { return quantity.val() - 273.15; }

constexpr inline Temperature from_farenheight(double value) { return Temperature((value - 32) * (5.0 / 9.0) + 273.15); }
constexpr inline Temperature from_fahrenheit(double value) { return Temperature((value - 32) * (5.0 / 9.0) + 273.15); }

constexpr inline double to_farenheight(Temperature quantity) { return (quantity.val() - 273.15) * (9.0 / 5.0) + 32; }
constexpr inline double to_fahrenheit(Temperature quantity) { return (quantity.val() - 273.15) * (9.0 / 5.0) + 32; }

} // namespace units
Loading