Settings

Theme

How-To Calibrate American Options Really Fast in C++

tastyhedge.com

2 points by gituliar 2 years ago · 2 comments

Reader

Bostonian 2 years ago

I've programmed in C++ only sporadically. Are the functions really declared to have type Error, or am I misreading things? For example one function starts as

   Error
   calibrateEuropean(
     f64    v,     //  option price
     f64    s,     //  stock price
  • gituliarOP 2 years ago

    Good observation!

    Basically `Error` is an alias to `std::string`. This way code is more meaningful as returning just std::string is too generic.

    It's also my convention to report errors as return arguments in this particular codebase, instead of throwing exceptions for example.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection