Added mass and remove unecesary private
This commit is contained in:
+15
-10
@@ -10,21 +10,22 @@ Liters :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_milli_liters procedure group.
|
||||
liters_to_milli_liters :: #force_inline proc "contextless" (
|
||||
liters: Liters($V),
|
||||
) -> Milli_Liters(V) where intrinsics.type_is_numeric(V) {
|
||||
return Milli_Liters(V){liters.v * MILLI}
|
||||
}
|
||||
|
||||
@(private = "file", fast_math = {.Allow_Reciprocal})
|
||||
// Prefer the to_gallons procedure group.
|
||||
@(fast_math = {.Allow_Reciprocal})
|
||||
liters_to_gallons :: #force_inline proc "contextless" (
|
||||
liters: Liters($V),
|
||||
) -> Gallons(V) where intrinsics.type_is_float(V) {
|
||||
return Gallons(V){liters.v / LITERS_PER_GALLON}
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_micro_liters procedure group.
|
||||
liters_to_micro_liters :: #force_inline proc "contextless" (
|
||||
liters: Liters($V),
|
||||
) -> Micro_Liters(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -36,14 +37,15 @@ Milli_Liters :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file", fast_math = {.Allow_Reciprocal})
|
||||
// Prefer the to_liters procedure group.
|
||||
@(fast_math = {.Allow_Reciprocal})
|
||||
milli_liters_to_liters :: #force_inline proc "contextless" (
|
||||
milli_liters: Milli_Liters($V),
|
||||
) -> Liters(V) where intrinsics.type_is_numeric(V) {
|
||||
return Liters(V){milli_liters.v / MILLI}
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_micro_liters procedure group.
|
||||
milli_liters_to_micro_liters :: #force_inline proc "contextless" (
|
||||
milli_liters: Milli_Liters($V),
|
||||
) -> Micro_Liters(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -55,21 +57,24 @@ Micro_Liters :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file", fast_math = {.Allow_Reciprocal})
|
||||
// Prefer the to_liters procedure group.
|
||||
@(fast_math = {.Allow_Reciprocal})
|
||||
micro_liters_to_liters :: #force_inline proc "contextless" (
|
||||
micro_liters: Micro_Liters($V),
|
||||
) -> Liters(V) where intrinsics.type_is_numeric(V) {
|
||||
return Liters(V){micro_liters.v / MICRO}
|
||||
}
|
||||
|
||||
@(private = "file", fast_math = {.Allow_Reciprocal})
|
||||
// Prefer the to_milli_liters procedure group.
|
||||
@(fast_math = {.Allow_Reciprocal})
|
||||
micro_liters_to_milli_liters :: #force_inline proc "contextless" (
|
||||
micro_liters: Micro_Liters($V),
|
||||
) -> Milli_Liters(V) where intrinsics.type_is_numeric(V) {
|
||||
return Milli_Liters(V){micro_liters.v / (MICRO / MILLI)}
|
||||
}
|
||||
|
||||
@(private = "file", fast_math = {.Allow_Reciprocal})
|
||||
// Prefer the to_gallons procedure group.
|
||||
@(fast_math = {.Allow_Reciprocal})
|
||||
micro_liters_to_gallons :: #force_inline proc "contextless" (
|
||||
micro_liters: Micro_Liters($V),
|
||||
) -> Gallons(V) where intrinsics.type_is_float(V) {
|
||||
@@ -81,14 +86,14 @@ Gallons :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_liters procedure group.
|
||||
gallons_to_liters :: #force_inline proc "contextless" (
|
||||
gallons: Gallons($V),
|
||||
) -> Liters(V) where intrinsics.type_is_float(V) {
|
||||
return Liters(V){gallons.v * LITERS_PER_GALLON}
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_micro_liters procedure group.
|
||||
gallons_to_micro_liters :: #force_inline proc "contextless" (
|
||||
gallons: Gallons($V),
|
||||
) -> Micro_Liters(V) where intrinsics.type_is_float(V) {
|
||||
|
||||
Reference in New Issue
Block a user