long doublenextafterl(long doublex,long doubley) ;
Return Type : long double
A floating-point type with extended precision, typically larger than `double` and used for high-precision arithmetic. The size and precision depend on the platform but are often 80 or 128 bits.
A floating-point type with extended precision, typically larger than `double` and used for high-precision arithmetic. The size and precision depend on the platform but are often 80 or 128 bits.
1st Parameter
The starting long double value.
2nd Parameter Type : long double
A floating-point type with extended precision, typically larger than `double` and used for high-precision arithmetic. The size and precision depend on the platform but are often 80 or 128 bits.
2nd Parameter
The target long double value towards which `x` will be incremented or decremented.
Read more about parameters of nextafterl in parameters section
The nextafterlfunction in C language Returns the next representable long double value of the first argument in the direction of the second argument.
The nextafterl function returns the next representable long double floating-point value following x in the direction of y. If x equals y, the function returns y. If either x or y is NaN, NaN is returned. This function is similar to nextafter but operates on long double precision numbers.
The nextafterlfunction takes 2
parameters:
•
long double `x`: The starting long double value.
•
long double `y`: The target long double value towards which `x` will be incremented or decremented.
Returns the next representable long double value after `x` in the direction of `y`. If `x` equals `y`, the function returns `y`. Handles subnormal values and overflows, returning ±infinity in the latter case. Useful for precise floating-point arithmetic and rounding in extended precision.
The nextafterl function return value :
Returns the next representable long double value after x in the direction of y
Output
This example demonstrates how nextafterl finds the next representable long double value in both positive and negative directions from zero.