File tree 3 files changed +6
-1
lines changed
3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
name = " Static"
2
2
uuid = " aedffcd0-7271-4cad-89d0-dc628f76c6d3"
3
3
authors = [" chriselrod" , " ChrisRackauckas" , " Tokazama" ]
4
- version = " 0.7.5 "
4
+ version = " 0.7.6 "
5
5
6
6
[deps ]
7
7
IfElse = " 615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
Original file line number Diff line number Diff line change @@ -312,6 +312,9 @@ Base.inv(x::StaticNumber{N}) where {N} = one(x) / x
312
312
@inline Base. iszero (@nospecialize x:: StaticNumber ) = false
313
313
@inline Base. isone (:: Union{One, FloatOne, True} ) = true
314
314
@inline Base. isone (@nospecialize x:: StaticNumber ) = false
315
+ @inline Base. iseven (@nospecialize x:: StaticNumber ) = iseven (known (x))
316
+ @inline Base. isodd (@nospecialize x:: StaticNumber ) = isodd (known (x))
317
+
315
318
316
319
Base. AbstractFloat (x:: StaticNumber ) = StaticFloat64 (x)
317
320
Original file line number Diff line number Diff line change 29
29
@test @inferred (one (StaticInt)) === StaticInt (1 )
30
30
@test @inferred (zero (StaticInt)) === StaticInt (0 ) === StaticInt (StaticInt (Val (0 )))
31
31
@test eltype (one (StaticInt)) <: Int
32
+ @test @inferred (isodd (one (StaticInt)))
33
+ @test @inferred (iseven (zero (StaticInt)))
32
34
33
35
x = StaticInt (1 )
34
36
y = static (3 )
You can’t perform that action at this time.
0 commit comments