function v=callopt(x,S0,ex,r,sigma,T)
% value of the discounted payoff times lognormal pdf of a call option with exercise price ex, r=annual interest 
% rate, sigma=annual vol, S0=current stock price. For Black-Scholes, integrate (ex,infinity).
v=exp(-r*T)*max((x-ex),0).*logn(x,S0*exp(r*T),sigma*sqrt(T));
