MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / nexttoward

Method nexttoward

extern/half/include/half.hpp:1834–1844  ·  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

1832 /// \param to direction to enumerate into
1833 /// \return next representable number
1834 static half nexttoward(half from, long double to)
1835 {
1836 if(isnan(from))
1837 return from;
1838 long double lfrom = static_cast<long double>(from);
1839 if(builtin_isnan(to) || lfrom == to)
1840 return half(static_cast<float>(to));
1841 if(!(from.data_&0x7FFF))
1842 return half(binary, (static_cast<detail::uint16>(builtin_signbit(to))<<15)+1);
1843 return half(binary, from.data_+(((from.data_>>15)^static_cast<unsigned>(lfrom<to))<<1)-1);
1844 }
1845
1846 /// Sign implementation
1847 /// \param x first operand

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected