//auch getestet double EuroBewerter::exchange_option_diff(double x, double y, double t, double T, double r, double delta, double sigma, int re) { double TStrich = T - t; double Wurzel = sqrt(2.) * sigma * sqrt(TStrich); double d1 = (log(x / y) + (sigma * sigma) * TStrich) / Wurzel; double d2 = (log(x / y) - (sigma * sigma) * TStrich) / Wurzel; //if(rand()%100==0) //printf("%f,\n",cnd(d1)); if (re == 0) return exp(-r * t - delta * (T - t)) * (cnd(d1) + (dnd(d1) - y / x * dnd(d2)) / Wurzel); else return exp(-r * t - delta * (T - t)) * (-cnd(d2) + (dnd(d2) - x / y * dnd(d1)) / Wurzel); }
LRESULT CALLBACK drag_and_drop_subclass(HWND widget, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR ptr, DWORD_PTR ref) { typedef drag_and_drop_handler_platform_data<SourceType, TargetType> dnd_type; dnd_type& dnd(*hackery::cast<dnd_type*>(ptr)); switch (message) { case WM_DROPFILES: { ::MessageBeep(MB_OK); return 0; } break; } return ::DefSubclassProc(dnd.widget_m, message, wParam, lParam); }