Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Finding the Next Greater Representable Value (float_next)

Synopsis

#include <boost/math/special_functions/next.hpp>

namespace boost{ namespace math{

template <class FPT>
FPT float_next(FPT val);

}} // namespaces
Description - float_next

Returns the next representable value which is greater than x. If x is non-finite then returns the result of a domain_error. If there is no such value greater than x then returns an overflow_error.

Has the same effect as

nextafter(val, std::numeric_limits<FPT>::max());

PrevUpHomeNext