hikyuu2/hikyuu_pywrap/_arithmetic.cpp

46 lines
1.1 KiB
C++
Raw Normal View History

2015-01-07 01:26:14 +08:00
/*
* _util.cpp
*
* Created on: 2011-12-4
* Author: fasiondog
*/
#include <boost/python.hpp>
2023-09-24 02:46:04 +08:00
#include <hikyuu/utilities/arithmetic.h>
2023-10-09 23:25:20 +08:00
#include "pybind_utils.h"
2015-01-07 01:26:14 +08:00
using namespace boost::python;
using namespace hku;
2023-09-24 02:46:04 +08:00
namespace py = boost::python;
2023-10-10 02:41:05 +08:00
using namespace hku;
2023-09-24 02:46:04 +08:00
2015-01-07 01:26:14 +08:00
void export_util() {
2020-07-04 00:15:54 +08:00
def("roundEx", roundEx, (arg("number"), arg("ndigits") = 0),
R"(roundEx(number[, ndigits=0])
ROUND_HALF_EVEN
:param float number
:param int ndigits
:rype: float)");
def("roundUp", roundUp, (arg("number"), arg("ndigits") = 0), R"(roundUp(number[, ndigits=0])
10.111
:param float number
:param int ndigits
:rtype: float)");
def("roundDown", roundDown, (arg("number"), arg("ndigits") = 0),
R"(roundDown(number[, ndigits=0])
10.110
:param float number
:param int ndigits
:rtype: float)");
2015-01-07 01:26:14 +08:00
}