We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a37de1 commit eb46696Copy full SHA for eb46696
2 files changed
src/stdstr.jl
@@ -42,7 +42,7 @@ function to_std_str(arg::Real)
42
end
43
44
function to_std_str(arg::Rational)
45
- out = string(arg)
+ out = string(arg.num) * "/" * string(arg.den)
46
47
return "(" * out * ")"
48
test/StdTest.jl
@@ -276,6 +276,13 @@ end
276
@test to_std(dc.UnaryOperation{dc.Abs}(mul(A, x))) == "abs(Ax)"
277
278
279
+@testset "to_std output is correct with rational exponent" begin
280
+ x = Variable("x", Upper(1))
281
+
282
+ @test to_std(dc.Power(2, 1//3)) == "2^(1/3)"
283
+ @test to_std(dc.Power(x, 1//3)) == "x^(1/3)"
284
+end
285
286
@testset "to_std output is correct with sgn" begin
287
x = Variable("x", Upper(2))
288
A = Variable("A", Upper(1), Lower(2))
0 commit comments