You’re using integer division.
Try 7.0/10
instead.
More Related Contents:
- why i multiply many number make a mistake when i division?
- The main thing is: how that binary for example 11110000 is divided into two parts such as s1=1111 and s2=0000. I have to do this in Java
- Why does integer division code give the wrong answer? [duplicate]
- Division in Java always results in zero (0)? [duplicate]
- Why does (360 / 24) / 60 = 0 … in Java
- Double value returns 0 [duplicate]
- Why does dividing a float by an integer return 0.0?
- ArithmeticException thrown during BigDecimal.divide
- Why is Java’s division broken?
- Unexpected result in long/int division
- Integer division in Java [duplicate]
- (a * b) / c MulDiv and dealing with overflow from intermediate multiplication
- Passing an Object to a method and returning a list of Objects any example [closed]
- While you save a file in .csv,how to remove the hyphen in the file name
- How to call a SOAP web service on Android [closed]
- Appending to an ObjectOutputStream
- Can we connect remote MySQL database in Android using JDBC? [closed]
- Draw with lines in Java
- Can I override and overload static methods in Java?
- Spring Java Config: how do you create a prototype-scoped @Bean with runtime arguments?
- Is there an easy way to output two columns to the console in Java?
- DateTimeFormatter month pattern letter “L” fails
- How to find an available port?
- Mock Instant.now() without using Clock into Constructor or without Clock Object
- Java: NullPointerException from class.getResource( … )
- Where to close java PreparedStatements and ResultSets?
- Simple timeout in java
- Java – Storing SQL statements in an external file [closed]
- Encoded password does not look like BCrypt
- Creating a factory method in Java that doesn’t rely on if-else