Finding minimum normalized positive number

In summary, the conversation discusses the process of finding the minimum normalized positive number that can be represented in a computer. The value is 2.2250738585072014e-308 and the program is used to find the machine precision. The speaker suggests making some parameter changes, such as changing the cast to a double, and looking in the limits.h file for relevant values.
  • #1
~electric~
14
0
Hello,
I was asked to write a C program to find minimum normalized positive number that can be represented in my computer. I know that the value is 2.2250738585072014e-308.
I wrote the program to find the machine precision. Now i need to make some parameter changes to this program to find the min. number given above.
do
{
Epsilon = Epsilon/2.0 ; //Variable value is halved until the smallest
//value of 'e' is found while meeting the
//required condition
}
while ((float)((Epsilon+1.0))>1.0);

Epsilon = 2*Epsilon;

this gave me the machine precision. Any help would be appreciated.
thanks in advance.
 
Technology news on Phys.org
  • #2
I'm confused. You've casted Epsilon to a float (single precision), yet the value you shows is the POSIX value for min double precision numbers. Make Epsilon a double precision variable, and change the cast (float) to (double) - for starters.

Also, look in the limits.h file (unless you are on windows) for DBL_MIN and FLT_MIN.
 
  • #3


Hi there,

Great job on finding the machine precision! To find the minimum normalized positive number, you can use the same approach but with a slight modification. Instead of starting with Epsilon=1, start with a larger value such as 1.0e+100. Then, continue dividing it by 2 until the smallest value of 'e' is found while still meeting the condition of ((Epsilon+1.0))>1.0. This will give you the minimum normalized positive number, which in your case is 2.2250738585072014e-308.

Hope this helps! Keep up the good work.
 

1. What is the minimum normalized positive number?

The minimum normalized positive number is the smallest positive number that can be represented in a given number system. It is typically denoted as the number 1 followed by a series of zeros and a decimal point, such as 0.0001 in base 10.

2. How is the minimum normalized positive number calculated?

The calculation of the minimum normalized positive number depends on the number system being used. In base 10, it is calculated by raising the base (10) to the power of the smallest possible exponent (usually -308 for double-precision floating-point numbers).

3. What is the significance of the minimum normalized positive number?

The minimum normalized positive number is important because it sets the lower bound for the precision of a number system. Any number smaller than the minimum normalized positive number cannot be accurately represented in that system.

4. Can the minimum normalized positive number vary between different computer systems?

Yes, the minimum normalized positive number can vary between computer systems depending on the number of bits used to represent numbers and the chosen number system. For example, the minimum normalized positive number in base 2 (binary) is different from the minimum normalized positive number in base 10 (decimal).

5. How is the minimum normalized positive number related to machine epsilon?

Machine epsilon is defined as the difference between 1 and the next largest number that can be represented in a given number system. The minimum normalized positive number is equal to half of the machine epsilon. In other words, it is the smallest number that, when added to 1, results in a number larger than 1 in that system.

Similar threads

  • Programming and Computer Science
Replies
8
Views
2K
  • Programming and Computer Science
Replies
22
Views
766
Replies
1
Views
1K
  • Programming and Computer Science
Replies
30
Views
4K
Replies
4
Views
932
  • Computing and Technology
Replies
4
Views
769
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
22
Views
4K
Replies
13
Views
1K
  • Programming and Computer Science
Replies
29
Views
3K
Back
Top