Bug 522610 The implementation of RealFunctions::ToInteger is incorrect 

Change-Id: Ie941db6182478c68a18f686fd7eb50adfdf74876
Signed-off-by: jeremie.tatibouet <jeremie.tatibouet@cea.fr>
diff --git a/bundles/core/libraries/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/ToInteger.java b/bundles/core/libraries/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/ToInteger.java
index 5a5a5eb..60d45da 100644
--- a/bundles/core/libraries/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/ToInteger.java
+++ b/bundles/core/libraries/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/ToInteger.java
@@ -29,9 +29,8 @@
 	public void doBody(List<IParameterValue> inputParameters, List<IParameterValue> outputParameters) {
 		try {
 			Double x = ((RealValue) inputParameters.get(0).getValues().get(0)).value;
-			String y = x.toString();
 			IIntegerValue result = new IntegerValue();
-			result.setValue(new Integer(y));
+			result.setValue((int) (x >= 0 ? Math.floor(x) : -Math.floor(Math.abs(x))));
 			result.setType((PrimitiveType) this.locus.getFactory().getBuiltInType("Integer"));
 			List<IValue> outputs = new ArrayList<IValue>();
 			outputs.add(result);