madking153
- 37
- 0
hi, how to determine the machine precision in MATLAB and estimate from this how many bits are used in the mantissa ??
The discussion focuses on determining machine precision, also known as machine epsilon, in MATLAB. Users can implement a routine to find machine epsilon by repeatedly halving a number until it no longer affects the result of an addition operation with 1.0. The first algorithm provided, which checks if x is less than 2.0, is recommended for accuracy, while the second algorithm, which compares to zero, yields a smaller but less reliable epsilon. MATLAB R14 outputs an epsilon value of 2.2204e-016, aligning with the results from the C implementation of the algorithms.
PREREQUISITESMathematics students, engineers, and software developers who require precise numerical computations in MATLAB or are interested in understanding floating-point precision issues.
madking153 said:hi, how to determine the machine precision in MATLAB and estimate from this how many bits are used in the mantissa ??
ZapperZ said:1. x = 1.0
2. x = (x/2) + 1.0
3. If x > 1.0, go do (2) again