We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad5659d commit 485b8ebCopy full SHA for 485b8eb
src/ITime.jl
@@ -415,6 +415,8 @@ function Base.float(t::T) where {T <: ITime}
415
end
416
417
418
+(::Type{FT})(t::ITime) where {FT <: AbstractFloat} = FT(float(t))
419
+
420
macro itime_unary_op(op)
421
return esc(
422
quote
test/itime.jl
@@ -148,6 +148,8 @@ using Test, Dates
148
@testset "Float Conversion and Broadcasting" begin
149
t1 = ITime(10, period = Dates.Millisecond(100))
150
@test float(t1) == 1.0
151
+ @test Float64(t1) === Float64(1)
152
+ @test Float32(t1) === Float32(1)
153
154
# Test broadcasting (simple example)
155
@test float.(t1) == 1.0
0 commit comments