WITH_CTL_FLD(ctl_ratio_t rtun, CTL_FLD_RTUN, f, nf, ratio) { /* the actual formula is (pP + qQ)/(p+q) but we have * to represent it as p/(p+q) for the multiplicative bit * and qQ/(p+q) for the additive bit. * P is the market price, Q the rights price, for a * rights-to-underlying ratio of q/p. */ res.mktprc.r = ctl_ratio_recipr(ctl_adex_to_newo(rtun)); res.outsec.r = ctl_adex_to_newo(rtun); res.nomval.r = ctl_ratio_recipr(ctl_adex_to_newo(rtun)); WITH_CTL_FLD(ctl_price_t prpp, CTL_FLD_PRPP, f, nf, price) { res.mktprc.a = prpp * rtun.p; res.nomval.a = 0.df; res.outsec.a = 0.df; }
WITH_CTL_FLD(ctl_ratio_t adex, CTL_FLD_ADEX, f, nf, ratio) { res.mktprc.r = ctl_ratio_recipr(ctl_adex_to_newo(adex)); }
WITH_CTL_FLD(ctl_ratio_t newo, CTL_FLD_NEWO, f, nf, ratio) { res.mktprc.r = ctl_ratio_recipr(newo); res.nomval.r = ctl_ratio_recipr(newo); res.outsec.r = newo; }