@@ -212,7 +212,27 @@ public Expr add(double other) {
212
212
public Expr addRev (double other ) {
213
213
return Add .simplifiedIns (new SymDouble (other ), this );
214
214
}
215
-
215
+ /**
216
+ * Operator overload support for Groovy:
217
+ * a+b
218
+ * @param other
219
+ * @return
220
+ */
221
+ public Expr plus (Expr other ) {
222
+ return Add .simplifiedIns (this , other );
223
+ }
224
+ public Expr plus (int other ) {
225
+ return Add .simplifiedIns (this , new SymInteger (other ));
226
+ }
227
+ public Expr plus (long other ) {
228
+ return Add .simplifiedIns (this , new SymLong (other ));
229
+ }
230
+ public Expr plus (float other ) {
231
+ return Add .simplifiedIns (this , new SymFloat (other ));
232
+ }
233
+ public Expr plus (double other ) {
234
+ return Add .simplifiedIns (this , new SymDouble (other ));
235
+ }
216
236
/**
217
237
* Operator overload support:
218
238
* a-b
@@ -246,7 +266,27 @@ public Expr subtract(double other) {
246
266
public Expr subtractRev (double other ) {
247
267
return Subtract .simplifiedIns (new SymDouble (other ), this );
248
268
}
249
-
269
+ /**
270
+ * Operator overload support for Groovy:
271
+ * a-b
272
+ * @param other
273
+ * @return
274
+ */
275
+ public Expr minus (Expr other ) {
276
+ return Subtract .simplifiedIns (this , other );
277
+ }
278
+ public Expr minus (int other ) {
279
+ return Subtract .simplifiedIns (this , new SymInteger (other ));
280
+ }
281
+ public Expr minus (long other ) {
282
+ return Subtract .simplifiedIns (this , new SymLong (other ));
283
+ }
284
+ public Expr minus (float other ) {
285
+ return Subtract .simplifiedIns (this , new SymFloat (other ));
286
+ }
287
+ public Expr minus (double other ) {
288
+ return Subtract .simplifiedIns (this , new SymDouble (other ));
289
+ }
250
290
/**
251
291
* Operator overload support:
252
292
* a*b
@@ -314,7 +354,27 @@ public Expr divide(double other) {
314
354
public Expr divideRev (double other ) {
315
355
return Divide .simplifiedIns (new SymDouble (other ), this );
316
356
}
317
-
357
+ /**
358
+ * Operator overload support for Groovy:
359
+ * a/b
360
+ * @param other
361
+ * @return
362
+ */
363
+ public Expr div (Expr other ) {
364
+ return Divide .simplifiedIns (this , other );
365
+ }
366
+ public Expr divi (int other ) {
367
+ return Divide .simplifiedIns (this , new SymInteger (other ));
368
+ }
369
+ public Expr div (long other ) {
370
+ return Divide .simplifiedIns (this , new SymLong (other ));
371
+ }
372
+ public Expr div (float other ) {
373
+ return Divide .simplifiedIns (this , new SymFloat (other ));
374
+ }
375
+ public Expr div (double other ) {
376
+ return Divide .simplifiedIns (this , new SymDouble (other ));
377
+ }
318
378
/**
319
379
* Operator overload support:
320
380
* -a
0 commit comments