File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ Base.:*(r::RationalPoly, p::APL) = (r.num * p) / r.den
66
66
Base.:* (α, r:: RationalPoly ) = (α * r. num) / r. den
67
67
Base.:* (r:: RationalPoly , α) = (r. num * α) / r. den
68
68
69
- Base. zero (:: RationalPoly{NT} ) where {NT} = zero (NT) / one (NT )
69
+ Base. zero (r :: RationalPoly ) = zero (typeof (r) )
70
70
Base. zero (:: Type{RationalPoly{NT, DT}} ) where {NT, DT} = zero (NT) / one (DT)
71
- Base. one (:: RationalPoly{NT} ) where {NT} = one (NT) / one (NT )
71
+ Base. one (r :: RationalPoly ) = one (typeof (r) )
72
72
Base. one (:: Type{RationalPoly{NT, DT}} ) where {NT, DT} = one (NT) / one (DT)
Original file line number Diff line number Diff line change 28
28
@test x / x^ 2 == inv (x)
29
29
@test isone (((x+ 1 ) / (x- 1 )) / ((x+ 1 ) / (x- 1 )))
30
30
@test ((x+ 1 )^ 2 / (x- 1 )) / ((x+ 1 ) / (x- 1 )) == x+ 1
31
- poly = x+ 1 / x
31
+ poly = ( x+ 1 ) / (x + 2.0 )
32
32
RType = typeof (poly)
33
33
@test RType (true ) == one (RType)
34
34
@test RType (false ) == zero (RType)
35
- @test one (RType) isa RationalPoly
36
- @test zero (RType) isa RationalPoly
37
- @test one (poly) isa RationalPoly
38
- @test zero (poly) isa RationalPoly
35
+ @test one (RType) isa RType
36
+ @test zero (RType) isa RType
37
+ @test one (poly) isa RType
38
+ @test zero (poly) isa RType
39
39
end
You can’t perform that action at this time.
0 commit comments