Determining 'realmax' and 'realmin'

Click For Summary
SUMMARY

This discussion focuses on calculating 'realmax' and 'realmin' from a hypothetical distribution of bits in floating-point representation. The correct formulas derived are 'realmax' = (1-eps)*2^(127) and 'realmin' = (0.5)*2^(-128), with eps defined as 2^(-55). The initial confusion regarding the inclusion of NaN, Infinity, and offset exponents was clarified, emphasizing that these factors were not relevant to the problem at hand.

PREREQUISITES
  • Understanding of floating-point representation in computer science
  • Familiarity with the concepts of mantissa and exponent
  • Knowledge of the significance of epsilon (eps) in numerical computations
  • Basic mathematical skills for manipulating powers of two
NEXT STEPS
  • Study IEEE 754 floating-point standard for deeper insights
  • Learn about the implications of precision and rounding in floating-point arithmetic
  • Explore the concept of machine epsilon and its applications
  • Investigate the effects of floating-point representation on numerical stability
USEFUL FOR

Computer scientists, software engineers, and anyone involved in numerical computing or algorithm development will benefit from this discussion.

KennyRodgers
Messages
8
Reaction score
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
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   Reactions: jim mcnamara
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   Reactions: pbuk

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
3
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
10
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
6K