Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : nextafter

doublenextafter(double x,double y) ;

Return Type : double

Double-precision floating point (±1.7E±308, ~15 decimal digits)
Read about return values of nextafter function .

1st Parameter Type : double

Double-precision floating point (±1.7E±308, ~15 decimal digits)

1st Parameter

The starting floating-point value.

2nd Parameter Type : double

Double-precision floating point (±1.7E±308, ~15 decimal digits)

2nd Parameter

The target floating-point value towards which `x` will be incremented or decremented.

Read more about parameters of nextafter in parameters section
The nextafterfunction in C language Returns the next representable value of the first argument in the direction of the second argument.
The nextafter function returns the next representable double-precision 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.
The nextafterfunction takes 2 parameters:
  • double `x`: The starting floating-point value.
  • double `y`: The target floating-point value towards which `x` will be incremented or decremented.
Returns the next representable floating-point 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.
The nextafter function return value :
  • Returns the next representable value after x in the direction of y

Output

This example shows how nextafter finds the next representable value in both positive and negative directions from zero.