Skip to main content

Single Precision vs Double Precision

Here you will learn about Single Precision vs Double Precision.

When talking about the numbers, amount of precision that can be reached using a representation technique has always been the major area of interest for the researchers. This curiosity to increase the precision and challenge the representation limits of numerical values, in computer science, lead to two major achievements – single precision and double precision.

Single Precision

Single precision is the 32 bit representation of numerical values in computers. It is also known as binary32. Some languages, like JAVA, C++ use float to store these kinds of numerals. Some languages (Visual Basic) refer single numerals as single.

Single precision is most widely used because of its capability to represent wide range of numeral values, though it reduces the amount of precision achieved.

Single precision uses 32 bit to represent a floating point number.

First bit represent the sign of the number, negative or positive.

Next 8 bits are used to store the exponent of the number. This exponent can be signed 8-bit integer ranging from -127 – 128 of signed integer (0 to 255).

And the left 23 bits are used to represent the fraction part and are called fraction bits.

8 exponent bits provide us with the range and 23 bits provide us with the actual precision.

Double Precision

Double precision is called binary64. Double precision uses 64 bits to represent a value.

First bit is used for the same purpose as in single point precision i.e., represents sign of the number.

Next 11 bits are used to denote exponent, which provide us with the range, and has 3 more bits than single precision, so it is used to represent a wider range of values.

Next 52 bits are used to represent the fractional part which is 29 bits more than binary32 bit representation scheme. So it has a greater precision than single precision.

Double floating point precision are used where high arithmetic precision is required and number like – 2/19 have to be used. Double point precision requires more memory as compared to single precision, hence are not useful when normal calculations are to be performed. This representation technique finds its use in the scientific calculations.

Single Precision vs Double Precision

Image Source

Single Precision vs Double Precision

Single Precision Double Precision
Is binary32 bit representation scheme. Is binary64 bit representation scheme.
Uses 32 bit memory to represent a value. Uses 64 bit memory to represent a value.
Uses 1 bit to represent sign. Uses 1 bit to represent sign.
Uses 8 bits to represent exponent. Uses 11 bits to represent exponent.
Uses 23 bits to represent fractional part. Uses 52 bits to represent fractional part.
Is widely used in games and programs requiring less precision and wide representation. Finds its use in the area to scientific calculations, where precision is all that matters and approximation is to be minimized.

Comment below if you queries related to difference between Single Precision and Double Precision.

The post Single Precision vs Double Precision appeared first on The Crazy Programmer.



from The Crazy Programmer https://www.thecrazyprogrammer.com/2018/04/single-precision-vs-double-precision.html

Comments

Popular posts from this blog

dotnet sdk list and dotnet sdk latest

Can someone make .NET Core better with a simple global command? Fanie Reynders did and he did it in a simple and elegant way. I'm envious, in fact, because I spec'ed this exact thing out in a meeting a few months ago but I could have just done it like he did and I would have used fewer keystrokes! Last year when .NET Core was just getting started, there was a "DNVM" helper command that you could use to simplify dealing with multiple versions of the .NET SDK on one machine. Later, rather than 'switching global SDK versions,' switching was simplified to be handled on a folder by folder basis. That meant that if you had a project in a folder with no global.json that pinned the SDK version, your project would use the latest installed version. If you liked, you could create a global.json file and pin your project's folder to a specific version. Great, but I would constantly have to google to remember the format for the global.json file, and I'd constan

15 Web Design Trends to Watch in 2018

The modern world is full of extraordinary things that influence our imagination and mood. Our soul needs a perfect atmosphere and impressive spots. To apply such things in practice, we have submitted the list of the web trends that deserve your attention. Robert frost design analysis will meet all your wishes and expectations. Image Source Web Design Trends to Watch in 2018 1. More Organic Shapes Until this year, web design, as well as mobile design, were based on the right-angled and sharp-edged shapes. However, it seems that this year will bring some significant changes in the field of web design. The recent trends will offer the absolute rounded corners. In addition, the web design of 2018 will make the real things look like the cartoonish ones. 2.   Bold Minimalism Although some of you may think that this web design trend will not attract the Internet users. Indeed, the notion of minimalism is often associated with boredom and dullness. However, in this case, bold minimalis

R vs Python for Machine Learning

There are so many things to learn before to choose which language is good for Machine Learning. We will discuss each and everything about R as well as Python and the situation or problem in which situation we have to use which language. Let’s start Python and R are the two most Commonly used Programming Languages for Machine Learning and because of the popularity of both the languages Novice or you can say fresher are getting confused, whether they should choose R or Python language to commence their career in the Machine learning domain. Don’t worry guys through this article we will discuss R vs Python for Machine Learning. So, without exaggerating this article let’s get started. We will start it from the very Basics things or definitions. R vs Python for Machine Learning Introduction R is a programming language made by statisticians and data miners for statistical analysis and graphics supported by R foundation for statistical computing. R also provides high-quality graphics and