xo-unit: fixup ex5 implementation
This commit is contained in:
parent
8c09ee456d
commit
3b2fa29821
2 changed files with 7 additions and 6 deletions
|
|
@ -9,6 +9,6 @@ xo_add_executable(${SELF_EXE} ${SELF_SRCS})
|
|||
# dependencies..
|
||||
|
||||
xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
|
||||
#xo_dependency(${SELF_EXE} reflect)
|
||||
xo_dependency(${SELF_EXE} xo_flatstring)
|
||||
|
||||
# end CMakeLists.txt
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
/** @file ex5.cpp **/
|
||||
|
||||
#include "xo/unit/mpl/quantity.hpp"
|
||||
#include "xo/unit/quantity.hpp"
|
||||
#include "xo/unit/quantity_iostream.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main () {
|
||||
namespace u = xo::unit::units;
|
||||
namespace qty = xo::unit::qty;
|
||||
//namespace u = xo::unit::units;
|
||||
namespace q = xo::qty::qty;
|
||||
using namespace std;
|
||||
|
||||
/* 20% volatility over 250 days (approx number of trading days in one year) */
|
||||
auto q1 = qty::volatility250d(0.2);
|
||||
auto q1 = q::volatility_250d(0.2);
|
||||
/* 10% volatility over 30 days */
|
||||
auto q2 = qty::volatility30d(0.1);
|
||||
auto q2 = q::volatility_30d(0.1);
|
||||
|
||||
auto sum = q1 + q2;
|
||||
auto prod = q1 * q2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue