Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Stock <[email protected]>
  • Loading branch information
eliascarv and sostock authored Dec 18, 2024
1 parent 8becfd6 commit 89da4a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/conversion.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
UnitConversionFactor(x::T) where {T<:AbstractFloat}
UnitConversionFactor(x::AbstractFloat)
Conversion factor with value `x`.
Used by the [`convfact`](@ref) function to preserve
Expand All @@ -11,6 +11,8 @@ struct UnitConversionFactor{T<:AbstractFloat} <: AbstractIrrational
UnitConversionFactor(x::T) where {T<:AbstractFloat} = new{T}(x)
end

Base.:*(a::UnitConversionFactor, b::BigFloat) = a.x * b
Base.:*(a::BigFloat, b::UnitConversionFactor) = a * b.x
Base.:(==)(a::UnitConversionFactor, b::UnitConversionFactor) = a.x == b.x
Base.hash(x::UnitConversionFactor, h::UInt) = hash(x.x, h)
Base.BigFloat(x::UnitConversionFactor) = BigFloat(x.x)
Expand Down

0 comments on commit 89da4a7

Please sign in to comment.