Journal of ICT Research and Applications
Vol. 12 No. 3 (2018)

Performance Analysis of BigDecimal Arithmetic Operation in Java

Jos Timanta Tarigan (Faculty of Computer Science and Information Technology, Universitas Sumatera Utara, Jalan Universitas No.9, Padang Bulan, Medan Baru, Kota Medan 20222, Sumatera Utara)
Elviawaty M. Zamzami (Faculty of Computer Science and Information Technology, Universitas Sumatera Utara, Jalan Universitas No.9, Padang Bulan, Medan Baru, Kota Medan 20222, Sumatera Utara)
Cindy Laurent Ginting (Faculty of Computer Science and Information Technology, Universitas Sumatera Utara, Jalan Universitas No.9, Padang Bulan, Medan Baru, Kota Medan 20222, Sumatera Utara,)



Article Info

Publish Date
31 Dec 2018

Abstract

The Java programming language provides binary floating-point primitive data types such as float and double to represent decimal numbers. However, these data types cannot represent decimal numbers with complete accuracy, which may cause precision errors while performing calculations. To achieve better precision, Java provides the BigDecimal class. Unlike float and double, which use approximation, this class is able to represent the exact value of a decimal number. However, it comes with a drawback: BigDecimal is treated as an object and requires additional CPU and memory usage to operate with. In this paper, statistical data are presented of performance impact on using BigDecimal compared to the double data type. As test cases, common mathematical processes were used, such as calculating mean value, sorting, and multiplying matrices.

Copyrights © 2018






Journal Info

Abbrev

jictra

Publisher

Subject

Computer Science & IT

Description

Journal of ICT Research and Applications welcomes full research articles in the area of Information and Communication Technology from the following subject areas: Information Theory, Signal Processing, Electronics, Computer Network, Telecommunication, Wireless & Mobile Computing, Internet ...