Determining 'realmax' and 'realmin'

In summary, the conversation discusses the process of calculating the 'realmax' and 'realmin' from a hypothetical distribution of bits. It is determined that the maximum and minimum bounds for m and n are given, and therefore the values for 'realmax' and 'realmin' can be calculated without considering NaN, infinity, or an offset exponent. The final values for 'realmax' and 'realmin' are determined to be 2^(127) and 2^(-129), respectively. The conversation also touches on the value of eps, which is calculated to be 2^(-55).
  • #1
KennyRodgers
8
1
Summary:: figuring the 'realmax' and 'realmin' from a hypothetical distribution of bits

I am attempting to figure the 'realmax' and the 'realmin' from this hypothetical distribution of bits.
Capture.PNG

I know the largest the mantissa can be is (1-eps), and the smallest is just 1/2. Also I note the restriction on m. I want to convert m so it is in the range from [1,2]. So m' = m*2.
However, I am not sure if I need to recalculate the exponent range to accommodate 3 bits for 0, infinity and NAN. Thus I keep thinking the exponent range should be 256 - 2 = 254 -> 254/2 = 127 -> -126 < n < 127 where -127 is reserved for 0. Also, 256 and 255 are reserved for infinity and Nan, thus we have 256 - 2

I think realmax = (1-eps)*2*2^(127) = (1-eps)*2^(128)
and realmin = (0.5)*2*2^(-126) = 2^(-126)

Thoughts?
 
Physics news on Phys.org
  • #2
KennyRodgers said:
Thoughts?
You are confusing the situation in the question with other things you have learned about floating point. The question doesn't say anything about NaN, Infinity or an offset exponent, it gives you maximum and minimum bounds for ## m ## and ## n ## and an expression to substitute them into.

Do you think that a correct answer would be stated in terms of your value "eps", or is an actual number required?
 
  • Like
Likes jim mcnamara
  • #3
pbuk said:
You are confusing the situation in the question with other things you have learned about floating point. The question doesn't say anything about NaN, Infinity or an offset exponent, it gives you maximum and minimum bounds for ## m ## and ## n ## and an expression to substitute them into.

Do you think that a correct answer would be stated in terms of your value "eps", or is an actual number required?
After some clarification from a peer, I find that you are correct; no NaN, infinity or offset. essentially I was overthinking.
'realmax' is just (1-eps)*2^(127) ≈ 2^(127) and 'realmin' = (0.5)*2^(-128) = 2^(-129)
we did not need to state the value of "eps" for 'realmin' or 'realmax', but the last question does ask for the value of eps, which is just eps = 2^(-55)
 
  • Like
Likes pbuk

1. What is the purpose of determining 'realmax' and 'realmin' in scientific calculations?

The realmax and realmin values are used to represent the largest and smallest possible numbers in a given data type. They are important for ensuring accurate and precise calculations, particularly when working with very large or very small numbers.

2. How do you determine the 'realmax' and 'realmin' values for a specific data type?

The 'realmax' and 'realmin' values can be determined by looking at the specifications for the data type. For example, in MATLAB, the 'realmax' and 'realmin' values for a double precision floating-point number are 1.7977e+308 and 2.2251e-308, respectively.

3. Are the 'realmax' and 'realmin' values the same for all data types?

No, the 'realmax' and 'realmin' values can vary depending on the data type. For example, the 'realmax' and 'realmin' values for a single precision floating-point number are 3.4028e+38 and 1.1755e-38, respectively.

4. How do 'realmax' and 'realmin' values affect the accuracy of calculations?

'Realmax' and 'realmin' values determine the range of numbers that can be accurately represented in a given data type. If a number falls outside of this range, it may be rounded or truncated, leading to potential inaccuracies in calculations.

5. Can the 'realmax' and 'realmin' values be changed or adjusted?

No, the 'realmax' and 'realmin' values are fixed for each data type and cannot be changed. However, there are methods for working with larger or smaller numbers, such as using scientific notation or increasing the precision of the data type.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
627
  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • Computing and Technology
Replies
4
Views
775
  • Programming and Computer Science
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
4
Views
938
  • Engineering and Comp Sci Homework Help
Replies
5
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
Back
Top