Alternative for nextafter when backporting to visual studio 2013

80 views Asked by At

I am backporting a project from VS 2017 to VS 2013.
Looks like the function std::nextafter is not available in VS 2013.

Can anyone please suggest a workaround or alternative?

1

There are 1 answers

0
wohlstad On

As other mentioned it is not clear why you need to go back to such an ancient version.

In any case, the documentation for VS2013 contains this function:

double _nextafter( 
    double x, 
    double y  
);

Which is described as:

returns the closest representable neighbor of x in the direction toward y.

It seems to be the same as std::nextafter that you wish to replace (where x is from and y is to).