fun main() { val c = 0.2 + 0.2.2 val d = 3.5 + 4.3 + 5.1 println(d) // trả về 12.8999999999999 println(c) // trả về 0.42000000000004 }
Kết quả này đúng hay sai ạ?
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
fun main() { val c = 0.2 + 0.2.2 val d = 3.5 + 4.3 + 5.1 println(d) // trả về 12.8999999999999 println(c) // trả về 0.42000000000004 }
Kết quả này đúng hay sai ạ?
fun main() { val c = BigDecimal("0.2") + BigDecimal("0.22") val d = BigDecimal("3.5") + BigDecimal("4.3") + BigDecimal("5.1") println(d) // trả về 12.9 println(c) // trả về 0.42 }
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Input your email to receive reset password link, or if you remember your password, you can click