aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorAlain Béarez <abearez@apache.org>2019-05-21 00:14:12 +0000
committerAlain Béarez <abearez@apache.org>2019-05-21 00:14:12 +0000
commit928e6937f40754450a42ad3c5a106908bd083105 (patch)
treeff1ffc784ab8628b619a68a675f40f2a9bf1558c /src/examples
parent906c52d81d625ae2fce9905c38a4ad29fb77caf1 (diff)
downloadpoi-928e6937f40754450a42ad3c5a106908bd083105.tar.gz
poi-928e6937f40754450a42ad3c5a106908bd083105.zip
fix result of multiplication cast to wider type
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1859595 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java6
-rw-r--r--src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
index d00bd9c87c..a1e84efba5 100644
--- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
+++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
@@ -102,9 +102,9 @@ public class BigExample {
// create a numeric cell
c = r.createCell(cellnum);
// do some goofy math to demonstrate decimals
- c.setCellValue(rownum * 10000 + cellnum
- + (((double) rownum / 1000)
- + ((double) cellnum / 10000)));
+ c.setCellValue((rownum * 10000.0) + cellnum
+ + (rownum / 1000.0)
+ + (cellnum / 10000.0));
// on every other row
if ((rownum % 2) == 0) {
diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
index 6e6fc5b369..0484d6feef 100644
--- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
+++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
@@ -87,8 +87,8 @@ public final class HSSFReadWrite {
for (int cellnum = 0; cellnum < 50; cellnum += 2) {
HSSFCell c = r.createCell(cellnum);
- c.setCellValue(rownum * 10000 + cellnum
- + (((double) rownum / 1000) + ((double) cellnum / 10000)));
+ c.setCellValue((rownum * 10000.0) + cellnum
+ + (rownum / 1000.0) + (cellnum / 10000.0));
if ((rownum % 2) == 0) {
c.setCellStyle(cs);
}