From 1994a2d901e1ca948a53b3d00df9017782c47b5c Mon Sep 17 00:00:00 2001 From: Rex Kerr Date: Mon, 24 Feb 2014 16:45:56 -0800 Subject: SI-3235 math.round() returns wrong results for Int and Long Minimal fix for SI-3235. This minimal fix includes deprecation messages to aid detection of probable errors. Test verifies behavior: the correct values are returned, and deprecation messages are emitted. --- test/files/run/t3235-minimal.check | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/files/run/t3235-minimal.check (limited to 'test/files/run/t3235-minimal.check') diff --git a/test/files/run/t3235-minimal.check b/test/files/run/t3235-minimal.check new file mode 100644 index 0000000000..d7f716002f --- /dev/null +++ b/test/files/run/t3235-minimal.check @@ -0,0 +1,12 @@ +t3235-minimal.scala:3: warning: method round in class RichInt is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? + assert(123456789.round == 123456789) + ^ +t3235-minimal.scala:4: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? + assert(math.round(123456789) == 123456789) + ^ +t3235-minimal.scala:5: warning: method round in class RichLong is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? + assert(1234567890123456789L.round == 1234567890123456789L) + ^ +t3235-minimal.scala:6: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? + assert(math.round(1234567890123456789L) == 1234567890123456789L) + ^ -- cgit v1.2.3