Added mass and remove unecesary private (#41)
Co-authored-by: Zachary Levy <zachary@sunforge.is> Reviewed-on: #41
This commit was merged in pull request #41.
This commit is contained in:
+11
-10
@@ -30,21 +30,21 @@ Kelvins :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_celsius procedure group.
|
||||
kelvins_to_celsius :: #force_inline proc "contextless" (
|
||||
kelvins: Kelvins($V),
|
||||
) -> Celsius(V) where intrinsics.type_is_numeric(V) {
|
||||
return Celsius(V){kelvins.v - kelvins_celsius_offset(V)}
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_deci_kelvins procedure group.
|
||||
kelvins_to_deci_kelvins :: #force_inline proc "contextless" (
|
||||
kelvins: Kelvins($V),
|
||||
) -> Deci_Kelvins(V) where intrinsics.type_is_numeric(V) {
|
||||
return Deci_Kelvins(V){kelvins.v * DECI}
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_fahrenheit procedure group.
|
||||
kelvins_to_fahrenheit :: #force_inline proc "contextless" (
|
||||
kelvins: Kelvins($V),
|
||||
) -> Fahrenheit(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -56,7 +56,7 @@ Deci_Kelvins :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_kelvins procedure group.
|
||||
deci_kelvins_to_kelvins :: #force_inline proc "contextless" (
|
||||
deci_kelvins: Deci_Kelvins($V),
|
||||
) -> Kelvins(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -68,21 +68,22 @@ Celsius :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_kelvins procedure group.
|
||||
celsius_to_kelvins :: #force_inline proc "contextless" (
|
||||
degrees_celsius: Celsius($V),
|
||||
) -> Kelvins(V) where intrinsics.type_is_numeric(V) {
|
||||
return Kelvins(V){degrees_celsius.v + kelvins_celsius_offset(V)}
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_deci_celsius procedure group.
|
||||
celsius_to_deci_celsius :: #force_inline proc "contextless" (
|
||||
degrees_celsius: Celsius($V),
|
||||
) -> Deci_Celsius(V) where intrinsics.type_is_numeric(V) {
|
||||
return Deci_Celsius(V){degrees_celsius.v * DECI}
|
||||
}
|
||||
|
||||
@(private = "file", fast_math = {.Allow_Contract})
|
||||
// Prefer the to_fahrenheit procedure group.
|
||||
@(fast_math = {.Allow_Contract})
|
||||
celsius_to_fahrenheit :: #force_inline proc "contextless" (
|
||||
degrees_celsius: Celsius($V),
|
||||
) -> Fahrenheit(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -98,7 +99,7 @@ Deci_Celsius :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_celsius procedure group.
|
||||
deci_celsius_to_celsius :: #force_inline proc "contextless" (
|
||||
deci_degrees_celsius: Deci_Celsius($V),
|
||||
) -> Celsius(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -110,7 +111,7 @@ Fahrenheit :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_celsius procedure group.
|
||||
fahrenheit_to_celsius :: #force_inline proc "contextless" (
|
||||
degrees_fahrenheit: Fahrenheit($V),
|
||||
) -> Celsius(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -121,7 +122,7 @@ fahrenheit_to_celsius :: #force_inline proc "contextless" (
|
||||
}
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_kelvins procedure group.
|
||||
fahrenheit_to_kelvins :: #force_inline proc "contextless" (
|
||||
degrees_fahrenheit: Fahrenheit($V),
|
||||
) -> Kelvins(V) where intrinsics.type_is_numeric(V) {
|
||||
|
||||
Reference in New Issue
Block a user