floating point - Does Java's BigDecimal leverage the hardware architecture like long double in C++? -


as understand it, long double in c++ leverages hardware architecture (at least architectures). bigdecimal in java small enough inputs?

does bigdecimal in java small enough inputs?

no, , not. floating-point numbers lossy, while every bigdecimal has associated precision, , can represent number below precision. there no "small enough input" can usefully rendered floating point number, because if happen have bigdecimal value can represented in floating-point notation, you'd hard-pressed sort of operations on value , maintain specified precision.

put way, purpose of bigdecimal offer precision while sacrificing speed. runs contrary floating-point, sacrifices precision in favor of speed.


it sounds you're asking if java offers way work long double sized floating-point numbers, , there not. can conclude fact it's not provided jdk authors have never felt necessary add language.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -