# Signed floating point numbers

Were present real numbers in our daily life is not convenient for representing very small numbers, like +0.00000012347650. This same number can be more conveniently represented in scientific notation as +1.23476× 10−07. But this actually stands for +0.000000123476. So there is an error of 0.00000000000005, which forms a very small percentage error.

Floating-point representation is similar in concept to scientific notation. Logically, a floating-point number consists of:

• A signed (meaning positive or negative) digit string of a given length in a given base(or radix).This digit string is referred to as the significand, mantissa, or coefficient.

• A signed integer exponent which modifies the magnitude of the number.

It is important to note that floating-point numbers suffer from loss of precision when represented with a fixed number of bits (e.g., 32-bit or 64-bit). This is because there is an infinite number of real numbers (even within a small range of says 0.0 to 0.1). On the other hand, a n-bit binary pattern can represent a finite 2n distinct numbers. Hence, not all the real numbers can be represented. Floating number arithmetic is very much less efficient than integer arithmetic. Hence, it is better to use integers if an application does not require floating-point numbers. The nearest approximation will be used instead, resulted in the loss of accuracy. Modern computers adopt IEEE 754 standard for representing floating-point numbers. There are two representation schemes: 32-bit single-precision and 64-bit double-precision.

IEEE floating point numbers have three basic components: the sign, the exponent, and the mantissa. The mantissa is composed of the fraction and an implicit leading digit (explained below). The exponent base (2) is implicit and need not be stored.

The following table shows the layout for the single (32-bit) and double(64-bit) precision floating-point values. The number of bits for each field is shown, followed by the bit ranges in square brackets. 00 =least-significant bit.

 Sign Exponent Fraction Single Precision 1 [31] 8 [30–23] 23 [22–00] DoublePrecision 1 [63] 11 [62–52] 52 [51–00]

Laid out as bits, floating point numbers look like this −

Single Precision − SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF

Double Precision − SEEEEEEE EEEEFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF

Updated on: 27-Jun-2020

1K+ Views
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://www.tutorialspoint.com/signed-floating-point-numbers", "fetch_time": 1720967040000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-30/segments/1720763514580.77/warc/CC-MAIN-20240714124600-20240714154600-00613.warc.gz", "warc_record_offset": 912498631, "warc_record_length": 26233, "token_count": 562, "char_count": 2427, "score": 3.90625, "int_score": 4, "crawl": "CC-MAIN-2024-30", "snapshot_type": "latest", "language": "en", "language_score": 0.8848997354507446, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00058-of-00064.parquet"}