File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -200,8 +200,7 @@ struct FnType{X<:Tuple,Y} end
200200
201201function (f:: Symbolic )(args... )
202202 error (" Sym $f is not callable. " *
203- " Use @syms $f (var1, var2,...) to create it as a callable. " *
204- " See ?@fun for more options" )
203+ " Use @syms $f (var1, var2,...) to create it as a callable." )
205204end
206205
207206"""
494493function show_mul (io, args)
495494 length (args) == 1 && return print_arg (io, * , args[1 ])
496495
497- paren_scalar = args[1 ] isa Complex || args[1 ] isa Rational || (args[1 ] isa Number && ! isfinite (args[1 ]))
496+ paren_scalar = ( args[1 ] isa Complex && ! _iszero ( imag (args[ 1 ]))) || args[1 ] isa Rational || (args[1 ] isa Number && ! isfinite (args[1 ]))
498497 minus = args[1 ] isa Number && args[1 ] == - 1
499498 unit = args[1 ] isa Number && args[1 ] == 1
500499 nostar = ! paren_scalar && args[1 ] isa Number && ! (args[2 ] isa Number)
831830
832831\ (a:: Number , b:: SN ) = b / a
833832
834- / (a:: SN , b:: Number ) = inv (b) * a
833+ / (a:: SN , b:: Number ) = (b isa Integer ? 1 // b : inv (b) ) * a
835834
836835// (a:: Union{SN, Number} , b:: SN ) = a / b
837836
Original file line number Diff line number Diff line change 123123 @test isequal (w == 0 , Term {Bool} (== , [w, 0 ]))
124124
125125 @eqtest x // 5 == (1 // 5 ) * x
126+ @eqtest (1 // 2 * x) / 5 == (1 // 10 ) * x
126127 @eqtest x // Int16 (5 ) == Rational {Int16} (1 , 5 ) * x
127128 @eqtest 5 // x == 5 / x
128129 @eqtest x // a == x / a
Original file line number Diff line number Diff line change @@ -6,17 +6,20 @@ seed!(6174)
66@testset " Fuzz test" begin
77 @time @testset " expand fuzz" begin
88 for i= 1 : 500
9+ i % 100 == 0 && @info " expand fuzz" iter= i
910 fuzz_test (5 , num_spec, SymbolicUtils. expand; min_depth= 3 )
1011 end
1112 end
1213 @time @testset " num fuzz" begin
1314 for i= 1 : 1500
15+ i % 100 == 0 && @info " num fuzz" iter= i
1416 fuzz_test (5 , num_spec)
1517 end
1618 end
1719 @time @testset " bool fuzz" begin
1820 for i= 1 : 500
1921 seed! (i)
22+ i % 100 == 0 && @info " bool fuzz" iter= i
2023 fuzz_test (5 , bool_spec)
2124 end
2225 end
You can’t perform that action at this time.
0 commit comments