Skip to content

Commit d7424c3

Browse files
authored
Call _string_round for numbers in nonlinear expressions (#4100)
1 parent 7ebe98c commit d7424c3

File tree

7 files changed

+78
-72
lines changed

7 files changed

+78
-72
lines changed

docs/src/manual/constraints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ julia> rhs = false
16231623
false
16241624
16251625
julia> @constraint(model, (x[1] == x[2]) == rhs)
1626-
(x[1] == x[2]) - 0.0 = 0
1626+
(x[1] == x[2]) - 0 = 0
16271627
16281628
julia> @constraint(model, x[1] == x[2] := rhs)
16291629
x[1] == x[2] = false

docs/src/manual/nonlinear.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ julia> model = Model();
3737
julia> @variable(model, x[1:2]);
3838
3939
julia> @constraint(model, exp(x[1]) <= 1)
40-
exp(x[1]) - 1.0 ≤ 0
40+
exp(x[1]) - 1 ≤ 0
4141
4242
julia> @constraint(model, con[i = 1:2], 2^x[i] >= i)
4343
2-element Vector{ConstraintRef{Model, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarNonlinearFunction, MathOptInterface.GreaterThan{Float64}}, ScalarShape}}:
44-
con[1] : (2.0 ^ x[1]) - 1.0 ≥ 0
45-
con[2] : (2.0 ^ x[2]) - 2.0 ≥ 0
44+
con[1] : (2 ^ x[1]) - 1 ≥ 0
45+
con[2] : (2 ^ x[2]) - 2 ≥ 0
4646
```
4747

4848
Delete a nonlinear constraint using [`delete`](@ref):
@@ -128,12 +128,12 @@ A [`NonlinearExpr`](@ref) can be used in [`@objective`](@ref),
128128

129129
```jldoctest nl_expression
130130
julia> @objective(model, Min, expr^2 + 1)
131-
((exp(x[1]) + sqrt(x[2])) ^ 2.0) + 1.0
131+
((exp(x[1]) + sqrt(x[2])) ^ 2) + 1
132132
133133
julia> @constraint(model, [i = 1:2], my_expr[i] <= i)
134134
2-element Vector{ConstraintRef{Model, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarNonlinearFunction, MathOptInterface.LessThan{Float64}}, ScalarShape}}:
135-
sin(x[1]) - 1.0 ≤ 0
136-
sin(x[2]) - 2.0 ≤ 0
135+
sin(x[1]) - 1 ≤ 0
136+
sin(x[2]) - 2 ≤ 0
137137
138138
julia> @expression(model, nested[i = 1:2], sin(my_expr[i]))
139139
2-element Vector{NonlinearExpr}:
@@ -169,10 +169,10 @@ julia> model = Model();
169169
julia> @variable(model, x[1:2]);
170170
171171
julia> @expression(model, expr, sum(exp.(x)))
172-
0.0 + exp(x[2]) + exp(x[1])
172+
0 + exp(x[2]) + exp(x[1])
173173
174174
julia> @objective(model, Min, sum(exp(x[i]) / expr for i in 1:2))
175-
(exp(x[1]) / (0.0 + exp(x[2]) + exp(x[1]))) + (exp(x[2]) / (0.0 + exp(x[2]) + exp(x[1])))
175+
(exp(x[1]) / (0 + exp(x[2]) + exp(x[1]))) + (exp(x[2]) / (0 + exp(x[2]) + exp(x[1])))
176176
```
177177
In this model, JuMP will compute the value (and derivatives) of the denominator
178178
twice, without realizing that it is the same expression.
@@ -189,7 +189,7 @@ julia> @variable(model, x[1:2]);
189189
julia> @variable(model, expr);
190190
191191
julia> @constraint(model, expr == sum(exp.(x)))
192-
expr - (0.0 + exp(x[2]) + exp(x[1])) = 0
192+
expr - (0 + exp(x[2]) + exp(x[1])) = 0
193193
194194
julia> @objective(model, Min, sum(exp(x[i]) / expr for i in 1:2))
195195
(exp(x[1]) / expr) + (exp(x[2]) / expr)
@@ -353,7 +353,7 @@ julia> model = Model();
353353
julia> @variable(model, x);
354354
355355
julia> expr = @expression(model, ifelse(x < -1 || x >= 1, x^2, 0.0))
356-
ifelse((x < -1) || (x >= 1), x², 0.0)
356+
ifelse((x < -1) || (x >= 1), x², 0)
357357
```
358358

359359
As an alternative, use the `JuMP.op_` functions, which fallback to the
@@ -368,7 +368,7 @@ julia> expr = op_ifelse(
368368
x^2,
369369
0.0,
370370
)
371-
ifelse((x < -1) || (x >= 1), x², 0.0)
371+
ifelse((x < -1) || (x >= 1), x², 0)
372372
```
373373

374374
The available functions are:

src/macros.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ julia> op_ifelse(true, 1.0, 2.0)
2121
1.0
2222
2323
julia> op_ifelse(x, 1.0, 2.0)
24-
ifelse(x, 1.0, 2.0)
24+
ifelse(x, 1, 2)
2525
2626
julia> op_ifelse(true, x, 2.0)
2727
x

src/macros/@force_nonlinear.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ julia> @expression(model, x * 2.0 * (1 + x) * x)
8181
(2 x² + 2 x) * x
8282
8383
julia> @expression(model, @force_nonlinear(x * 2.0 * (1 + x) * x))
84-
x * 2.0 * (1 + x) * x
84+
x * 2 * (1 + x) * x
8585
8686
julia> @allocated @expression(model, x * 2.0 * (1 + x) * x)
8787
3680

src/nlp_expr.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ julia> @variable(model, x)
6767
x
6868
6969
julia> f = sin(x)^2
70-
sin(x) ^ 2.0
70+
sin(x) ^ 2
7171
7272
julia> f = GenericNonlinearExpr{VariableRef}(
7373
:^,
7474
GenericNonlinearExpr{VariableRef}(:sin, x),
7575
2.0,
7676
)
77-
sin(x) ^ 2.0
77+
sin(x) ^ 2
7878
```
7979
"""
8080
struct GenericNonlinearExpr{V<:AbstractVariableRef} <: AbstractJuMPScalar
@@ -185,6 +185,12 @@ op_string(::MIME"text/latex", ::GenericNonlinearExpr, ::Val{:<=}) = "\\le"
185185
op_string(::MIME"text/latex", ::GenericNonlinearExpr, ::Val{:>=}) = "\\ge"
186186
op_string(::MIME"text/latex", ::GenericNonlinearExpr, ::Val{:(==)}) = "="
187187

188+
function _string_round_if_number(mode::MIME, x::Union{Float32,Float64})
189+
return _string_round(mode, x)
190+
end
191+
192+
_string_round_if_number(mode, x::Any) = x
193+
188194
function function_string(mime::MIME, x::GenericNonlinearExpr)
189195
p_left, p_right, p_open, p_close, p_textsf = _parens(mime)
190196
io, stack = IOBuffer(), Any[x]
@@ -213,7 +219,7 @@ function function_string(mime::MIME, x::GenericNonlinearExpr)
213219
push!(stack, arg.args[i])
214220
push!(stack, p_left)
215221
else
216-
push!(stack, arg.args[i])
222+
push!(stack, _string_round_if_number(mime, arg.args[i]))
217223
end
218224
if i > 1
219225
push!(stack, "$p_close $op $p_open")
@@ -223,11 +229,11 @@ function function_string(mime::MIME, x::GenericNonlinearExpr)
223229
print(io, p_textsf, p_open, op, p_close, p_left, p_open)
224230
push!(stack, p_close * p_right)
225231
for i in length(arg.args):-1:2
226-
push!(stack, arg.args[i])
232+
push!(stack, _string_round_if_number(mime, arg.args[i]))
227233
push!(stack, "$p_close, $p_open")
228234
end
229235
if length(arg.args) >= 1
230-
push!(stack, arg.args[1])
236+
push!(stack, _string_round_if_number(mime, arg.args[1]))
231237
end
232238
end
233239
elseif arg isa AbstractJuMPScalar
@@ -1196,7 +1202,7 @@ julia> @variable(model, x);
11961202
julia> @variable(model, y);
11971203
11981204
julia> f = sin(x)^1
1199-
sin(x) ^ 1.0
1205+
sin(x) ^ 1
12001206
12011207
julia> simplify(model, f)
12021208
sin(x)
@@ -1246,7 +1252,7 @@ julia> @variable(model, x);
12461252
julia> @variable(model, y);
12471253
12481254
julia> derivative(model, log(x), x)
1249-
1.0 / x
1255+
1 / x
12501256
12511257
julia> derivative(model, log(x), y)
12521258
0.0

test/test_nlp_expr.jl

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ function test_extension_expression(
7575
@test string(@expression(model, sin(x))) == "sin(x)"
7676
@test string(@expression(model, ifelse(x >= 0, x, 0))) ==
7777
"ifelse(x >= 0, x, 0)"
78-
@test string(@expression(model, 2^x)) == "2.0 ^ x"
78+
@test string(@expression(model, 2^x)) == "2 ^ x"
7979
@test string(@expression(model, x^x)) == "x ^ x"
80-
@test string(@expression(model, sin(x)^2)) == "sin(x) ^ 2.0"
81-
@test string(@expression(model, sin(x)^2.0)) == "sin(x) ^ 2.0"
82-
@test string(@expression(model, 2 * sin(x)^2.0)) == "2.0 * (sin(x) ^ 2.0)"
83-
@test string(@expression(model, 1 + sin(x))) == "1.0 + sin(x)"
84-
@test string(@expression(model, 1 + 2 * sin(x))) == "1.0 + (2.0 * sin(x))"
80+
@test string(@expression(model, sin(x)^2)) == "sin(x) ^ 2"
81+
@test string(@expression(model, sin(x)^2.0)) == "sin(x) ^ 2"
82+
@test string(@expression(model, 2 * sin(x)^2.0)) == "2 * (sin(x) ^ 2)"
83+
@test string(@expression(model, 1 + sin(x))) == "1 + sin(x)"
84+
@test string(@expression(model, 1 + 2 * sin(x))) == "1 + (2 * sin(x))"
8585
@test string(@expression(model, 2.0 * sin(x)^2 + cos(x) / x)) ==
86-
"(2.0 * (sin(x) ^ 2.0)) + (cos(x) / x)"
86+
"(2 * (sin(x) ^ 2)) + (cos(x) / x)"
8787
@test string(@expression(model, 2.0 * sin(x)^2 - cos(x) / x)) ==
88-
"(2.0 * (sin(x) ^ 2.0)) - (cos(x) / x)"
88+
"(2 * (sin(x) ^ 2)) - (cos(x) / x)"
8989
return
9090
end
9191

@@ -99,8 +99,8 @@ function test_extension_flatten_nary(
9999
expr_mult = GenericNonlinearExpr{VariableRefType}(:*, Any[x])
100100
expr_sin = GenericNonlinearExpr{VariableRefType}(:sin, Any[x])
101101
to_string(x) = string(flatten!(x))
102-
@test to_string(+(expr_plus, 1)) == "x + 1.0"
103-
@test to_string(+(1, expr_plus)) == "1.0 + x"
102+
@test to_string(+(expr_plus, 1)) == "x + 1"
103+
@test to_string(+(1, expr_plus)) == "1 + x"
104104
@test to_string(+(expr_plus, x)) == "x + x"
105105
@test to_string(+(expr_sin, x)) == "sin(x) + x"
106106
@test to_string(+(x, expr_plus)) == "x + x"
@@ -109,8 +109,8 @@ function test_extension_flatten_nary(
109109
@test to_string(+(expr_plus, expr_sin)) == "x + sin(x)"
110110
@test to_string(+(expr_sin, expr_plus)) == "sin(x) + x"
111111
@test to_string(+(expr_sin, expr_sin)) == "sin(x) + sin(x)"
112-
@test to_string(*(expr_mult, 2)) == "x * 2.0"
113-
@test to_string(*(2, expr_mult)) == "2.0 * x"
112+
@test to_string(*(expr_mult, 2)) == "x * 2"
113+
@test to_string(*(2, expr_mult)) == "2 * x"
114114
@test to_string(*(expr_mult, x)) == "x * x"
115115
@test to_string(*(expr_sin, x)) == "sin(x) * x"
116116
@test to_string(*(x, expr_mult)) == "x * x"
@@ -119,7 +119,7 @@ function test_extension_flatten_nary(
119119
@test to_string(*(expr_mult, expr_sin)) == "x * sin(x)"
120120
@test to_string(*(expr_sin, expr_mult)) == "sin(x) * x"
121121
@test to_string(*(expr_sin, expr_sin)) == "sin(x) * sin(x)"
122-
@test to_string(sin(+(expr_plus, 1))) == "sin(x + 1.0)"
122+
@test to_string(sin(+(expr_plus, 1))) == "sin(x + 1)"
123123
@test to_string(sin(*(expr_mult, expr_mult))) == "sin(x * x)"
124124
return
125125
end
@@ -128,8 +128,8 @@ function test_extension_zero_one(
128128
ModelType = Model,
129129
VariableRefType = VariableRef,
130130
)
131-
@test string(zero(GenericNonlinearExpr{VariableRefType})) == "+(0.0)"
132-
@test string(one(GenericNonlinearExpr{VariableRefType})) == "+(1.0)"
131+
@test string(zero(GenericNonlinearExpr{VariableRefType})) == "+(0)"
132+
@test string(one(GenericNonlinearExpr{VariableRefType})) == "+(1)"
133133
return
134134
end
135135

@@ -151,7 +151,7 @@ function test_extension_latex(ModelType = Model, VariableRefType = VariableRef)
151151

152152
@expression(model, g, ifelse(x > 0, sin(x), x + cos(x)^2))
153153
@test function_string(MIME("text/latex"), g) ==
154-
raw"\textsf{ifelse}\left({{x} > {0}}, {\textsf{sin}\left({x}\right)}, {{x} + {\left({\textsf{cos}\left({x}\right)} ^ {2.0}\right)}}\right)"
154+
raw"\textsf{ifelse}\left({{x} > {0}}, {\textsf{sin}\left({x}\right)}, {{x} + {\left({\textsf{cos}\left({x}\right)} ^ {2}\right)}}\right)"
155155
return
156156
end
157157

@@ -178,13 +178,13 @@ function test_extension_expression_addmul(
178178
)
179179
model = ModelType()
180180
@variable(model, x)
181-
@test string(@expression(model, x + 3 * sin(x))) == "x + (3.0 * sin(x))"
181+
@test string(@expression(model, x + 3 * sin(x))) == "x + (3 * sin(x))"
182182
@test string(@expression(model, 2 * x + 3 * sin(x))) ==
183-
"(2 x) + (3.0 * sin(x))"
183+
"(2 x) + (3 * sin(x))"
184184
@test string(@expression(model, x^2 + 3 * sin(x))) ==
185-
"($(x^2)) + (3.0 * sin(x))"
185+
"($(x^2)) + (3 * sin(x))"
186186
@test string(@expression(model, sin(x) + 3 * sin(x))) ==
187-
"sin(x) + (3.0 * sin(x))"
187+
"sin(x) + (3 * sin(x))"
188188
@test string(@expression(model, sin(x) + 3 * x)) == "sin(x) + (3 x)"
189189
@test string(@expression(model, sin(x) + 3 * x * x)) ==
190190
"sin(x) + (3 $(x^2))"
@@ -198,11 +198,11 @@ function test_extension_expression_explicit_add_mul(
198198
model = ModelType()
199199
@variable(model, x)
200200
f = sin(x)
201-
@test string(MA.operate!!(MA.add_mul, 1, 2, f)) == "1.0 + (2.0 * $f)"
202-
@test string(MA.operate!!(MA.add_mul, 1, f, 2)) == "1.0 + ($f * 2.0)"
203-
@test string(MA.operate!!(MA.add_mul, 1, f, f)) == "1.0 + ($f * $f)"
204-
@test string(MA.operate!!(MA.add_mul, f, 2, f)) == "$f + (2.0 * $f)"
205-
@test string(MA.operate!!(MA.add_mul, f, f, 2)) == "$f + ($f * 2.0)"
201+
@test string(MA.operate!!(MA.add_mul, 1, 2, f)) == "1 + (2 * $f)"
202+
@test string(MA.operate!!(MA.add_mul, 1, f, 2)) == "1 + ($f * 2)"
203+
@test string(MA.operate!!(MA.add_mul, 1, f, f)) == "1 + ($f * $f)"
204+
@test string(MA.operate!!(MA.add_mul, f, 2, f)) == "$f + (2 * $f)"
205+
@test string(MA.operate!!(MA.add_mul, f, f, 2)) == "$f + ($f * 2)"
206206
@test string(MA.operate!!(MA.add_mul, f, f, f)) == "$f + ($f * $f)"
207207
return
208208
end
@@ -213,13 +213,13 @@ function test_extension_expression_submul(
213213
)
214214
model = ModelType()
215215
@variable(model, x)
216-
@test string(@expression(model, x - 3 * sin(x))) == "x - (3.0 * sin(x))"
216+
@test string(@expression(model, x - 3 * sin(x))) == "x - (3 * sin(x))"
217217
@test string(@expression(model, 2 * x - 3 * sin(x))) ==
218-
"(2 x) - (3.0 * sin(x))"
218+
"(2 x) - (3 * sin(x))"
219219
@test string(@expression(model, x^2 - 3 * sin(x))) ==
220-
"($(x^2)) - (3.0 * sin(x))"
220+
"($(x^2)) - (3 * sin(x))"
221221
@test string(@expression(model, sin(x) - 3 * sin(x))) ==
222-
"sin(x) - (3.0 * sin(x))"
222+
"sin(x) - (3 * sin(x))"
223223
@test string(@expression(model, sin(x) - 3 * x)) == "sin(x) - (3 x)"
224224
@test string(@expression(model, sin(x) - 3 * x * x)) ==
225225
"sin(x) - (3 $(x^2))"
@@ -233,11 +233,11 @@ function test_extension_aff_expr_convert(
233233
model = ModelType()
234234
@variable(model, x)
235235
_to_string(x) = string(convert(GenericNonlinearExpr{VariableRefType}, x))
236-
@test _to_string(AffExpr(0.0)) == "+(0.0)"
237-
@test _to_string(AffExpr(1.0)) == "+(1.0)"
238-
@test _to_string(x + 1) == "x + 1.0"
239-
@test _to_string(2x + 1) == "(2.0 * x) + 1.0"
240-
@test _to_string(2x) == "2.0 * x"
236+
@test _to_string(AffExpr(0.0)) == "+(0)"
237+
@test _to_string(AffExpr(1.0)) == "+(1)"
238+
@test _to_string(x + 1) == "x + 1"
239+
@test _to_string(2x + 1) == "(2 * x) + 1"
240+
@test _to_string(2x) == "2 * x"
241241
return
242242
end
243243

@@ -248,17 +248,17 @@ function test_extension_quad_expr_convert(
248248
model = ModelType()
249249
@variable(model, x)
250250
_to_string(x) = string(convert(GenericNonlinearExpr{VariableRefType}, x))
251-
@test _to_string(QuadExpr(AffExpr(0.0))) == "+(0.0)"
252-
@test _to_string(QuadExpr(AffExpr(1.0))) == "+(1.0)"
253-
@test _to_string(x^2 + 1) == "(x * x) + 1.0"
254-
@test _to_string(2x^2 + 1) == "(2.0 * x * x) + 1.0"
255-
@test _to_string(2x^2) == "2.0 * x * x"
256-
@test _to_string(x^2 + x + 1) == "x + (x * x) + 1.0"
257-
@test _to_string(2x^2 + x + 1) == "x + (2.0 * x * x) + 1.0"
258-
@test _to_string(2x^2 + x) == "x + (2.0 * x * x)"
259-
@test _to_string(x^2 + 2x + 1) == "(2.0 * x) + (x * x) + 1.0"
260-
@test _to_string(2x^2 + 2x + 1) == "(2.0 * x) + (2.0 * x * x) + 1.0"
261-
@test _to_string(2x^2 + 2x) == "(2.0 * x) + (2.0 * x * x)"
251+
@test _to_string(QuadExpr(AffExpr(0.0))) == "+(0)"
252+
@test _to_string(QuadExpr(AffExpr(1.0))) == "+(1)"
253+
@test _to_string(x^2 + 1) == "(x * x) + 1"
254+
@test _to_string(2x^2 + 1) == "(2 * x * x) + 1"
255+
@test _to_string(2x^2) == "2 * x * x"
256+
@test _to_string(x^2 + x + 1) == "x + (x * x) + 1"
257+
@test _to_string(2x^2 + x + 1) == "x + (2 * x * x) + 1"
258+
@test _to_string(2x^2 + x) == "x + (2 * x * x)"
259+
@test _to_string(x^2 + 2x + 1) == "(2 * x) + (x * x) + 1"
260+
@test _to_string(2x^2 + 2x + 1) == "(2 * x) + (2 * x * x) + 1"
261+
@test _to_string(2x^2 + 2x) == "(2 * x) + (2 * x * x)"
262262
return
263263
end
264264

@@ -337,7 +337,7 @@ function test_user_defined_function_overload()
337337
register(model, :f, 1, f; autodiff = true)
338338
@test string(@expression(model, f(x))) == "f(x)"
339339
@test string(f(x) + f(x)) == "f(x) + f(x)"
340-
@test string(1 / (f(x) + f(x))) == "1.0 / (f(x) + f(x))"
340+
@test string(1 / (f(x) + f(x))) == "1 / (f(x) + f(x))"
341341
return
342342
end
343343

@@ -447,7 +447,7 @@ function test_extension_expr_mle(
447447
sum((data[i] - x)^2 for i in 1:n) / (2 * y^2)
448448
)
449449
@test string(obj) ==
450-
"(2.0 * log(1.0 / (2 $(y^2)))) - ((4 $(x^2) - 30 x + 85) / (2 $(y^2)))"
450+
"(2 * log(1 / (2 $(y^2)))) - ((4 $(x^2) - 30 x + 85) / (2 $(y^2)))"
451451
return
452452
end
453453

@@ -1006,11 +1006,11 @@ function test_printing_truncation()
10061006
@variable(model, x[1:100])
10071007
y = @expression(model, sum(sin.(x) .* 2))
10081008
@test occursin(
1009-
"(sin(x[72]) * 2.0) + [[...41 terms omitted...]] + (sin(x[30]) * 2.0)",
1009+
"(sin(x[72]) * 2) + [[...41 terms omitted...]] + (sin(x[30]) * 2)",
10101010
function_string(MIME("text/plain"), y),
10111011
)
10121012
@test occursin(
1013-
"{\\left({\\textsf{sin}\\left({x_{72}}\\right)} * {2.0}\\right) + {[[\\ldots\\text{41 terms omitted}\\ldots]]} + {\\left({\\textsf{sin}\\left({x_{30}}\\right)} * {2.0}\\right)}",
1013+
"{\\left({\\textsf{sin}\\left({x_{72}}\\right)} * {2}\\right) + {[[\\ldots\\text{41 terms omitted}\\ldots]]} + {\\left({\\textsf{sin}\\left({x_{30}}\\right)} * {2}\\right)}",
10141014
function_string(MIME("text/latex"), y),
10151015
)
10161016
return

test/test_operator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,12 @@ function test_extension_basic_operators_number(
351351
@test_expression_with_string 1.5 + aff "7.1 x + 4"
352352
@test_expression_with_string 1.5 - aff "-7.1 x - 1"
353353
@test_expression_with_string 2 * aff "14.2 x + 5"
354-
@test_expression_with_string 2 / aff "2.0 / (7.1 x + 2.5)"
354+
@test_expression_with_string 2 / aff "2 / (7.1 x + 2.5)"
355355
# 1-4 Number--QuadExpr
356356
@test_expression_with_string 1.5 + q "2.5 y*z + 7.1 x + 4"
357357
@test_expression_with_string 1.5 - q "-2.5 y*z - 7.1 x - 1"
358358
@test_expression_with_string 2 * q "5 y*z + 14.2 x + 5"
359-
@test_expression_with_string 2 / q "2.0 / (2.5 y*z + 7.1 x + 2.5)"
359+
@test_expression_with_string 2 / q "2 / (2.5 y*z + 7.1 x + 2.5)"
360360
return
361361
end
362362

0 commit comments

Comments
 (0)