Skip to content

Commit

Permalink
[lang] Move number extensions into io.sarl.lang.core.
Browse files Browse the repository at this point in the history
In order to be accessible when inlining is disable, the number
extensions must be available into the io.sarl.lang.core module.

see #876

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Nov 19, 2018
1 parent 56c77ad commit 9ebe793
Show file tree
Hide file tree
Showing 109 changed files with 93,085 additions and 2,658 deletions.
5 changes: 4 additions & 1 deletion main/coreplugins/io.sarl.lang.core/META-INF/MANIFEST.MF
Expand Up @@ -13,6 +13,9 @@ Export-Package: io.sarl.bootstrap,
io.sarl.lang.annotation,
io.sarl.lang.bugfixes.pending.pr106,
io.sarl.lang.core,
io.sarl.lang.scoping.batch,
io.sarl.lang.scoping.extensions.numbers.arithmetic,
io.sarl.lang.scoping.extensions.numbers.cast,
io.sarl.lang.scoping.extensions.numbers.comparison,
io.sarl.lang.scoping.extensions.time,
io.sarl.lang.util

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Expand Up @@ -19,7 +19,7 @@
* limitations under the License.
*/

package io.sarl.lang.scoping.numbers.arithmetic;
package io.sarl.lang.scoping.extensions.numbers.arithmetic;

import org.eclipse.xtext.xbase.lib.Inline;
import org.eclipse.xtext.xbase.lib.Pure;
Expand All @@ -31,7 +31,7 @@
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @since 0.7
* @see "https://githuright.com/eclipse/xtext-extras/issues/186"
* @see "https://github.com/eclipse/xtext-extras/issues/186"
*/
@SuppressWarnings("checkstyle:methodcount")
public final class DoubleArithmeticExtensions {
Expand Down Expand Up @@ -118,71 +118,6 @@ public static double operator_minus(Double left, float right) {
return left.doubleValue() - right;
}

/** The binary {@code minus} operator. This is the equivalent to
* the Java {@code -} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left-right}
*/
@Pure
@Inline(value = "($1.doubleValue() - $2.doubleValue())", constantExpression = true)
public static double operator_minus(Double left, Long right) {
return left.doubleValue() - right.doubleValue();
}

/** The binary {@code minus} operator. This is the equivalent to
* the Java {@code -} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left-right}
*/
@Pure
@Inline(value = "($1.doubleValue() - $2.doubleValue())", constantExpression = true)
public static double operator_minus(Double left, Byte right) {
return left.doubleValue() - right.doubleValue();
}

/** The binary {@code minus} operator. This is the equivalent to
* the Java {@code -} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left-right}
*/
@Pure
@Inline(value = "($1.doubleValue() - $2.doubleValue())", constantExpression = true)
public static double operator_minus(Double left, Float right) {
return left.doubleValue() - right.doubleValue();
}

/** The binary {@code minus} operator. This is the equivalent to
* the Java {@code -} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left-right}
*/
@Pure
@Inline(value = "($1.doubleValue() - $2.doubleValue())", constantExpression = true)
public static double operator_minus(Double left, Integer right) {
return left.doubleValue() - right.doubleValue();
}

/** The binary {@code minus} operator. This is the equivalent to
* the Java {@code -} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left-right}
*/
@Pure
@Inline(value = "($1.doubleValue() - $2.doubleValue())", constantExpression = true)
public static double operator_minus(Double left, Short right) {
return left.doubleValue() - right.doubleValue();
}

/** The binary {@code plus} operator. This is the equivalent to
* the Java {@code +} operator. This function is not null-safe.
*
Expand Down Expand Up @@ -261,71 +196,6 @@ public static double operator_plus(Double left, float right) {
return left.doubleValue() + right;
}

/** The binary {@code plus} operator. This is the equivalent to
* the Java {@code +} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left+right}
*/
@Pure
@Inline(value = "($1.doubleValue() + $2.doubleValue())", constantExpression = true)
public static double operator_plus(Double left, Long right) {
return left.doubleValue() + right.doubleValue();
}

/** The binary {@code plus} operator. This is the equivalent to
* the Java {@code +} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left+right}
*/
@Pure
@Inline(value = "($1.doubleValue() + $2.doubleValue())", constantExpression = true)
public static double operator_plus(Double left, Byte right) {
return left.doubleValue() + right.doubleValue();
}

/** The binary {@code plus} operator. This is the equivalent to
* the Java {@code +} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left+right}
*/
@Pure
@Inline(value = "($1.doubleValue() + $2.doubleValue())", constantExpression = true)
public static double operator_plus(Double left, Float right) {
return left.doubleValue() + right.doubleValue();
}

/** The binary {@code plus} operator. This is the equivalent to
* the Java {@code +} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left+right}
*/
@Pure
@Inline(value = "($1.doubleValue() + $2.doubleValue())", constantExpression = true)
public static double operator_plus(Double left, Integer right) {
return left.doubleValue() + right.doubleValue();
}

/** The binary {@code plus} operator. This is the equivalent to
* the Java {@code +} operator.
*
* @param left a number.
* @param right a number.
* @return {@code left+right}
*/
@Pure
@Inline(value = "($1.doubleValue() + $2.doubleValue())", constantExpression = true)
public static double operator_plus(Double left, Short right) {
return left.doubleValue() + right.doubleValue();
}

/** The binary {@code power} operator. This is the equivalent to
* the Java's {@code Math.pow()} function. This function is not null-safe.
*
Expand Down Expand Up @@ -482,71 +352,6 @@ public static double operator_divide(Double left, float right) {
return left.doubleValue() / right;
}

/** The binary {@code divide} operator. This is the equivalent to
* the Java {@code /} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left/right}
*/
@Pure
@Inline(value = "($1.doubleValue() / $2.doubleValue())", constantExpression = true)
public static double operator_divide(Double left, Long right) {
return left.doubleValue() / right.doubleValue();
}

/** The binary {@code divide} operator. This is the equivalent to
* the Java {@code /} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left/right}
*/
@Pure
@Inline(value = "($1.doubleValue() / $2.doubleValue())", constantExpression = true)
public static double operator_divide(Double left, Byte right) {
return left.doubleValue() / right.doubleValue();
}

/** The binary {@code divide} operator. This is the equivalent to
* the Java {@code /} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left/right}
*/
@Pure
@Inline(value = "($1.doubleValue() / $2.doubleValue())", constantExpression = true)
public static double operator_divide(Double left, Float right) {
return left.doubleValue() / right.doubleValue();
}

/** The binary {@code divide} operator. This is the equivalent to
* the Java {@code /} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left/right}
*/
@Pure
@Inline(value = "($1.doubleValue() / $2.doubleValue())", constantExpression = true)
public static double operator_divide(Double left, Integer right) {
return left.doubleValue() / right.doubleValue();
}

/** The binary {@code divide} operator. This is the equivalent to
* the Java {@code /} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left/right}
*/
@Pure
@Inline(value = "($1.doubleValue() / $2.doubleValue())", constantExpression = true)
public static double operator_divide(Double left, Short right) {
return left.doubleValue() / right.doubleValue();
}

/** The binary {@code multiply} operator. This is the equivalent to
* the Java {@code *} operator. This function is not null-safe.
*
Expand Down Expand Up @@ -625,71 +430,6 @@ public static double operator_multiply(Double left, float right) {
return left.doubleValue() * right;
}

/** The binary {@code multiply} operator. This is the equivalent to
* the Java {@code *} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left*right}
*/
@Pure
@Inline(value = "($1.doubleValue() * $2.doubleValue())", constantExpression = true)
public static double operator_multiply(Double left, Long right) {
return left.doubleValue() * right.doubleValue();
}

/** The binary {@code multiply} operator. This is the equivalent to
* the Java {@code *} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left*right}
*/
@Pure
@Inline(value = "($1.doubleValue() * $2.doubleValue())", constantExpression = true)
public static double operator_multiply(Double left, Byte right) {
return left.doubleValue() * right.doubleValue();
}

/** The binary {@code multiply} operator. This is the equivalent to
* the Java {@code *} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left*right}
*/
@Pure
@Inline(value = "($1.doubleValue() * $2.doubleValue())", constantExpression = true)
public static double operator_multiply(Double left, Float right) {
return left.doubleValue() * right.doubleValue();
}

/** The binary {@code multiply} operator. This is the equivalent to
* the Java {@code *} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left*right}
*/
@Pure
@Inline(value = "($1.doubleValue() * $2.doubleValue())", constantExpression = true)
public static double operator_multiply(Double left, Integer right) {
return left.doubleValue() * right.doubleValue();
}

/** The binary {@code multiply} operator. This is the equivalent to
* the Java {@code *} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left*right}
*/
@Pure
@Inline(value = "($1.doubleValue() * $2.doubleValue())", constantExpression = true)
public static double operator_multiply(Double left, Short right) {
return left.doubleValue() * right.doubleValue();
}

/** The binary {@code modulo} operator. This is the equivalent to
* the Java {@code %} operator. This function is not null-safe.
*
Expand Down Expand Up @@ -768,58 +508,6 @@ public static double operator_modulo(Double left, float right) {
return left.doubleValue() % right;
}

/** The binary {@code modulo} operator. This is the equivalent to
* the Java {@code %} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left%right}
*/
@Pure
@Inline(value = "($1.doubleValue() % $2.doubleValue())", constantExpression = true)
public static double operator_modulo(Double left, Long right) {
return left.doubleValue() % right.doubleValue();
}

/** The binary {@code modulo} operator. This is the equivalent to
* the Java {@code %} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left%right}
*/
@Pure
@Inline(value = "($1.doubleValue() % $2.byteValue())", constantExpression = true)
public static double operator_modulo(Double left, Byte right) {
return left.doubleValue() % right.byteValue();
}

/** The binary {@code modulo} operator. This is the equivalent to
* the Java {@code %} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left%right}
*/
@Pure
@Inline(value = "($1.doubleValue() % $2.doubleValue())", constantExpression = true)
public static double operator_modulo(Double left, Float right) {
return left.doubleValue() % right.doubleValue();
}

/** The binary {@code modulo} operator. This is the equivalent to
* the Java {@code %} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left%right}
*/
@Pure
@Inline(value = "($1.doubleValue() % $2.doubleValue())", constantExpression = true)
public static double operator_modulo(Double left, Integer right) {
return left.doubleValue() % right.doubleValue();
}

/** The binary {@code modulo} operator. This is the equivalent to
* the Java {@code %} operator. This function is not null-safe.
*
Expand All @@ -833,17 +521,4 @@ public static double operator_modulo(Double left, Number right) {
return left.doubleValue() % right.doubleValue();
}

/** The binary {@code modulo} operator. This is the equivalent to
* the Java {@code %} operator. This function is not null-safe.
*
* @param left a number.
* @param right a number.
* @return {@code left%right}
*/
@Pure
@Inline(value = "($1.doubleValue() % $2.doubleValue())", constantExpression = true)
public static double operator_modulo(Double left, Short right) {
return left.doubleValue() % right.doubleValue();
}

}

0 comments on commit 9ebe793

Please sign in to comment.