long doublenexttowardl(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.
Read about return values of nexttowardl function .
1st 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.
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 nexttowardl in parameters section
The nexttowardlfunction in C language Returns the next representable long double value of the first argument towards the second argument, specified as a long double.
The nexttowardl 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 nextafterl but uses long double precision for both arguments and the return value.
The nexttowardlfunction 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. This function is designed for precise floating-point arithmetic and rounding in extended precision.
The nexttowardl function return value :
Returns the next representable long double value after x in the direction of y
Output
This example demonstrates how nexttowardl finds the next representable long double value towards another long double value.