The following is a recoded version of your function to avoid the exponential oveflow problem ...
void NofT()
{
double a = 2.18;
double b = 0.656;
double airr = 9.982E-7;
double Ip = 30;
int time = 100; // min., total time.
int tcount = 100;
double dt = time/tcount;
double ma = b+(a+airr)*Ip;
double mc = b+(a-airr)*Ip;
double mb = sqrt((b+(a+airr)*Ip)^2.0 - (4.0*b*airr*Ip));
double Phi=((mb-mc)*(mb+mc))/(2.0*mb*(ma-mc));
double lnPhi=ln(Phi);
vector<double> vt;
vt.Data(0,((tcount-1)*dt),dt);
vector<double> n1;
n1.SetSize(vt.GetSize());
double Lna, Lnb;
for(int tt = 0; tt < tcount; tt++)
{
if((mb*vt[tt] < 665.0) || ((ma+mb)*vt[tt] < 665.0))
{
n1[tt] = Phi*((exp(mb*vt[tt])-1.0)*exp(-0.5*(ma+mb)*vt[tt]));
printf("n1[%d]=%f\n",tt ,n1[tt]);
}
else
{
Lna=mb*vt[tt];
Lnb=-0.5*(ma+mb)*vt[tt];
n1[tt]=exp(lnPhi+Lna+Lnb);
printf("n1[%d]=%f\n",tt ,n1[tt]);
}
}
}