/*============================================================================= Copyright (c) 2011-2016 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_COMPLEX_NEAREST_HPP #define SPROUT_COMPLEX_NEAREST_HPP #include #include #include #include #include #include namespace sprout { // // ceil // template inline SPROUT_CONSTEXPR sprout::complex ceil(sprout::complex const& x) { return sprout::complex(sprout::math::ceil(x.real()), sprout::math::ceil(x.imag())); } // // floor // template inline SPROUT_CONSTEXPR sprout::complex floor(sprout::complex const& x) { return sprout::complex(sprout::math::floor(x.real()), sprout::math::floor(x.imag())); } // // trunc // template inline SPROUT_CONSTEXPR sprout::complex trunc(sprout::complex const& x) { return sprout::complex(sprout::math::trunc(x.real()), sprout::math::trunc(x.imag())); } // // round // template inline SPROUT_CONSTEXPR sprout::complex round(sprout::complex const& x) { return sprout::complex(sprout::math::round(x.real()), sprout::math::round(x.imag())); } } // namespace sprout #endif // #ifndef SPROUT_COMPLEX_NEAREST_HPP