which assignments would yield a non-floating-point number for y? y = 32.0 + (x / (z + 1.0));
In the given mathematical expression
, the term is a floating-point number, and the use of in the denominator () ensures that the result of the division operation will be a floating-point number as well.
In this expression, will be a non-floating-point number (an integer) if both and are integers. If either or (or both) is a floating-point number, the result will be a floating-point number.
For example:
Non-floating-point Example:
- If (integer) and (integer), then .
Floating-point Example:
- If (floating-point) and (integer), then .
So, to yield a non-floating-point number for , both and should be integers in this particular expression. If or is a floating-point number, the result will be a floating-point number.
Comments
Post a Comment