Rounding of decimals with more than 15 decimal digits
Previously, if a decimal with more than 15 decimal digits is cut to 15 digits, the digits to the right of the 15th digit are erased and the 15th digit is added by 1. Now, the decimal is rounded to 15 digital places -- the 15th digit will be added by 1 only when the 16th digit is ≥ 5.
Assigning a float/double with a value out of range
Previously, if a float or double is assigned with a value out of range, the float/double value will be 65535. Now:
-
In 32-bit applications, the float/double value will be 0;
-
In 64-bit applications, the float/double value will be 65535.
Infinity and NaN formatting
In previous versions, infinities and NaNs would be formatted using a set of Visual C++-specific sentinel strings:
-
Infinity: 1.#INF
-
Quiet NaN: 1.#QNAN
-
Signaling NaN: 1.#SNAN
-
Indefinite NaN: 1.#IND
Any of these may have been prefixed by a sign and may have been formatted slightly differently depending on field width and precision would print 1.#J because the #INF would be “rounded” to a precision of 2 digits).
In the current version, following the C99 requirements on how infinities and NaNs are to be formatted, the new strings are as follows:
-
Infinity: inf
-
Quiet NaN: nan
-
Signaling NaN: nan(snan)
-
Indefinite NaN: nan(ind)
Any of these may be prefixed by a sign. If a capital format specifier is used (e.g. %F instead of %f) then the strings are printed in capital letters (e.g. INF instead of inf).
For example, the message box shows "1.#INF" in Version 2021 and "inf" in Version 2022.
Real lr_41,lr_42 lr_41 = (1.175495E-38) - 1 lr_42 = 3.402824E+38 Messagebox('',lr_42) //'1.#INF' in PB 2021; and 'inf' in PB 2022.