期刊论文详细信息
Journal of ICT Research and Applications
Performance Analysis of BigDecimal Arithmetic Operation in Java
Jos Timanta Tarigan1  Elviawaty M. Zamzami2 
[1] Faculty of Computer Science and Information Technology, Universitas Sumatera Utara, Jalan Universitas No.9, Padang Bulan, Medan Baru, Kota Medan 20222, Sumatera Utara;Faculty of Computer Science and Information Technology, Universitas Sumatera Utara, Jalan Universitas No.9, Padang Bulan, Medan Baru, Kota Medan 20222, Sumatera Utara,
关键词: BigDecimal arithmetic operation;    floating-point arithmetic;    numerical programming;    optimization;    programming language;   
DOI  :  10.5614/itbj.ict.res.appl.2018.12.3.5
学科分类:电子、光学、磁材料
来源: Institute for Research and Community Services ITB
PDF
【 摘 要 】

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.

【 授权许可】

CC BY   

【 预 览 】
附件列表
Files Size Format View
RO201910258879167ZK.pdf 170KB PDF download
  文献评价指标  
  下载次数:20次 浏览次数:12次