MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / nexttoward

Method nexttoward

include/half/half.hpp:1821–1831  ·  view source on GitHub ↗

Enumeration implementation. \param from number to increase/decrease \param to direction to enumerate into \return next representable number

Source from the content-addressed store, hash-verified

1819 /// \param to direction to enumerate into
1820 /// \return next representable number
1821 static half nexttoward(half from, long double to)
1822 {
1823 if(isnan(from))
1824 return from;
1825 long double lfrom = static_cast<long double>(from);
1826 if(builtin_isnan(to) || lfrom == to)
1827 return half(static_cast<float>(to));
1828 if(!(from.data_&0x7FFF))
1829 return half(binary, (static_cast<detail::uint16>(builtin_signbit(to))<<15)+1);
1830 return half(binary, from.data_+(((from.data_>>15)^static_cast<unsigned>(lfrom<to))<<1)-1);
1831 }
1832
1833 /// Sign implementation
1834 /// \param x first operand

Callers

nothing calls this directly

Calls 4

isnanFunction · 0.85
builtin_isnanFunction · 0.85
halfClass · 0.85
builtin_signbitFunction · 0.85

Tested by

no test coverage detected