[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] [PATCH] fix opSign: set to float, not to int



Signed-off-by: Tim Blechmann <tim@xxxxxxxxxx>
---
 Source/lang/LangSource/PyrMathOps.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Source/lang/LangSource/PyrMathOps.cpp b/Source/lang/LangSource/PyrMathOps.cpp
index d752543..8672d8b 100644
--- a/Source/lang/LangSource/PyrMathOps.cpp
+++ b/Source/lang/LangSource/PyrMathOps.cpp
@@ -218,7 +218,7 @@ int doSpecialUnaryArithMsg(VMGlobals *g, int numArgsPushed)
 				case opCeil : SetRaw(a, ceil(slotRawFloat(a))); break;
 				case opFloor : SetRaw(a, floor(slotRawFloat(a))); break;
 				case opFrac : SetRaw(a, sc_frac(slotRawFloat(a))); break;
-				case opSign : SetRaw(a, slotRawFloat(a) > 0. ? 1 : (slotRawFloat(a) == 0 ? 0 : -1)); break;
+				case opSign : SetRaw(a, slotRawFloat(a) > 0. ? 1.0 : (slotRawFloat(a) == 0 ? 0.0 : -1.0)); break;
 				case opSquared : SetRaw(a, slotRawFloat(a) * slotRawFloat(a)); break;
 				case opCubed : SetRaw(a, slotRawFloat(a) * slotRawFloat(a) * slotRawFloat(a)); break;
 				case opSqrt : SetRaw(a, sqrt(slotRawFloat(a))); break;

Attachment: signature.asc
Description: OpenPGP digital signature