| Summary: | [Xbase] NumberExtensions and IntegerExtensions | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sven Efftinge <sven.efftinge> |
| Component: | Xtext | Assignee: | Jan Koehnlein <jan> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | jan, tmf.xtext-inbox |
| Version: | 2.2.0 | Flags: | sven.efftinge:
juno+
|
| Target Milestone: | M4 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Sven Efftinge
Integer and Double pushed to MASTER. Now heading for BigInteger and BigDecimal Bound the following operators ! && || == != for (boolean, boolean) - + ** * / % || && == != < <= > >= ! for (int, int) and (Integer, Number) - + ** * / % || && == != < <= > >= ! .. for (Integer, Number) - + ** * / == != < <= > >= for (double, double) - + ** * / for (Double, Number) - + ** * / for (BigDecimal, BigDecimal) - + ** * / % || && ! for (BigInteger, BigInteger) Into the bargain, I've added the shift operators from Java as methods. For the Object types, there is no need to override the default Comparable binding, as long as we don't plan to support comparing e.g. Double to BigInteger transparently. I've skipped char, byte, short and float in this first shot. I've also skipped mixed primitve operations like int+double. Pushed to MASTER Found a problem with autoboxing. Generated Java code doesn't comple, because operator_plus(new Integer(a), 1) is ambiguos. The XbaseCompiler now explicitly boxes and unboxes primitives and their wrappers. Also converted bit operations on integer types into methods which are more suggestive to non-mathematicians ;-) Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |