Clear Filters
Clear Filters

Value of a discontinuous function within the discontinuity point

9 views (last 30 days)
I have a jump discontinuous scalar function f:R->R
with "a" some real (say positive) number and f1,2 scalar continuous functions.
I wonder what is the smallest value close to the right of "a" which Matlab recognizes, is it given by using eps(a)?
Also, could it be possible to exist some lacunar/missing/"invisible" value for Matlab, in the right-neighborhood of "a" for which f cannot be calculated (even f is defined on R) ?

Accepted Answer

Walter Roberson
Walter Roberson on 13 Jan 2023
Supposing that A is exactly a representable number then the smallest value greater than A that MATLAB can represent is A+eps(A). Keep in mind however that A+eps(A)/2 is probably going to round to A+eps(A)
Any value A+delta will round to something, either to A or to at least A+eps(A), and the function can be calculated on the rounded value.
Notice that I said above "Assuming that A is exactly a representable number". Most decimal numbers are not exactly representable. For example, 0.1 is not exactly representable.
Suppose that you had a function that was described mathematically as having a boundary at 1/10 and the right hand side involves log(A-1/10). Mathematically any value A strictly greater than 1/10 will have a positive subtraction and the log would be of a positive value. But with 1/10 exactly not being exactly representable you have to worry about whether there is any value that is mathematically less than 1/10 whose representation rounds upward and so mathematically A-1/10 would be negative but the representation of A rounds up so the comparison of representation_of_A to 1/10 might succeed. Would the representation minus 1/10 potentially give negative even though the comparison succeeded? The answer depends on exactly how the subtraction is coded. For example (10*A - 1)/10 is algebraically A-1/10 but due to rounding the calculated result could be different.
Marius-F. Danca
Marius-F. Danca on 14 Jan 2023
OK, now is clear: both for mathematically and numerically approach f is defined (and can be calculated) for "all" x \in R, (mathematically "all"=infinity of real numebrs, numerically "all"=a lot of real numbers), right?
Again: I need some of these reasonings into a scientific paper and I want to acknowledge it, but beside your name I need your affiliation
Walter Roberson
Walter Roberson on 14 Jan 2023
Another way of looking at it is that by the Pigeon Hole Principle, if you have an N-bit representation of numbers, then that can represent at most 2^N different numbers, and other numbers cannot exactly exist within that system. This should be no more astonishing than if you have an integer data type and notice that the integer data type cannot represent fractions.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!