How Computer deal with Floating point numbers

  • Mantissa –0 represents a positive,1 represents a negative
  • The Biased exponent –A bias is added to the actual exponent in order to get the stored exponent.
  • The Normalized Mantissa –The part of a number in scientific notation or a floating-point number, consisting of its significant digits. Either 0 or1. So a normalized mantissa is one with only one 1 to the left of the decimal.

BigDecimal in Java

We can solve this problem using the java BigDecimal class. Java BidDecimal class provides operations for arithmetic, comparison, hashing, rounding, manipulation, and format conversion.
for the arithmetic operation, it provide add(), substract(), divide(), and multiply() methods.




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Upulie Handalage

Upulie Handalage

Everything in my point of view. Here for you to read on....