mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-06 14:24:09 +00:00
fix complex, rational
This commit is contained in:
parent
cdb10c0fbe
commit
6b3f7ad894
19 changed files with 1568 additions and 1360 deletions
30
sprout/complex/nearest.hpp
Normal file
30
sprout/complex/nearest.hpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef SPROUT_COMPLEX_NEAREST_HPP
|
||||
#define SPROUT_COMPLEX_NEAREST_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/complex/complex.hpp>
|
||||
#include <sprout/math/ceil.hpp>
|
||||
#include <sprout/math/floor.hpp>
|
||||
#include <sprout/math/trunc.hpp>
|
||||
#include <sprout/math/round.hpp>
|
||||
|
||||
namespace sprout {
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::complex<T> ceil(sprout::complex<T> const& x) {
|
||||
return sprout::complex<T>(sprout::ceil(x.real()), sprout::ceil(x.imag()));
|
||||
}
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::complex<T> floor(sprout::complex<T> const& x) {
|
||||
return sprout::complex<T>(sprout::floor(x.real()), sprout::floor(x.imag()));
|
||||
}
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::complex<T> trunc(sprout::complex<T> const& x) {
|
||||
return sprout::complex<T>(sprout::trunc(x.real()), sprout::trunc(x.imag()));
|
||||
}
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR sprout::complex<T> round(sprout::complex<T> const& x) {
|
||||
return sprout::complex<T>(sprout::round(x.real()), sprout::round(x.imag()));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_COMPLEX_NEAREST_HPP
|
Loading…
Add table
Add a link
Reference in a new issue