Click here to Skip to main content
13,797,167 members
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

6.2K views
2 bookmarked
Posted 13 Jan 2018
Licenced CPOL

What is the Lower Limit of Floating Point?

, 13 Jan 2018
Rate this:
Please Sign up or sign in to vote.
Microsoft Versus Google: Who is correct?

Microsoft Versus Google: Who is Correct?

Microsoft Floating Point Range in C# Documentation

Microsoft Floating Point Range

Google Floating Point Range Returned from its Search

Google Floating Point Range

While their higher float point limit tallied, Microsoft and Google are giving different values for lower limit! What is going on? One of them has to be correct! Make a guess before the answer is unveiled!

Answer

Both Microsoft and Google are correct! Google answer is correct from normalized number perspective while Microsoft lower range takes into account subnormal numbers (also known as denormalized numbers).

As you may recollect from your computer science school days, IEEE 754 floating point format consists of 3 components: a sign bit, mantissa and exponent. The actual value is derived from multiplying mantissa by base number raised to power of exponent.

Normal Floating Point

In a normal floating point number, its mantissa always implies a leading binary one on left side of decimal point. Since it is always present, mantissa does not store this leading one.

1.xxxx

Since the left side of decimal point is always one, how do you store, say 0.5?

0.5 can be derived from multiplying 1(mantissa) with 2 raised to power of -1(exponent).
Note: Mantissa and exponent values are stored in base 2, not base 10, so we raise 2 to power of exponent.

1 * 2^(-1) = 0.5

Subnormal Floating Point

In a subnormal floating point number, its mantissa has a leading binary zero on the left side of decimal point.

0.xxxx

But but... didn't I just tell you the left leading one is always there? So how is a subnormal number defined? To give you a definitive answer, we have to go through every nook and cranny of floating point format which is, frankly speaking, too long to fit into this short tip. Do not worry! This is one article in the series of bite-sized articles culminating into a final exhaustive article, "Deconstructing Floating Point Format" about everything you need to know on floating point. If this article series pique your interest on floating point, be sure to stay tuned for the final article!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Cake Processor
Software Developer (Senior)
Singapore Singapore
Right now, I am picking up DevOps skills at Pluralsight and pursuing CCNA certification. Stay tuned for my CCNA related article!

Coding Tidbit Blog

Latest blogpost: C++ – The Forgotten Trojan Horse by Eric Johnson

IT Certifications

  • IT Infrastructure Library Foundational (ITIL v3)
  • Scrum Alliance Certified Scrum Master (CSM)
  • Certified Secure Software Lifecycle Professional (CSSLP)

View my certificates here.

You may also be interested in...

Comments and Discussions

 
Questiondifference is ~0.0 and negative infinity Pin
Member 1070168315-Jan-18 21:47
professionalMember 1070168315-Jan-18 21:47 
AnswerRe: difference is ~0.0 and negative infinity Pin
Luis Perez Garcia15-Jan-18 23:00
memberLuis Perez Garcia15-Jan-18 23:00 
QuestionSlightly relevant: The precision of trigonometric functions Pin
Member 798912215-Jan-18 11:58
memberMember 798912215-Jan-18 11:58 
QuestionDid you really say anything about Google's lower limit? Pin
Member 798912215-Jan-18 11:29
memberMember 798912215-Jan-18 11:29 
Generalvery good review Pin
Southmountain13-Jan-18 10:22
memberSouthmountain13-Jan-18 10:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.181207.3 | Last Updated 13 Jan 2018
Article Copyright 2018 by Cake Processor
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid