fTerm = ScGetDDB(fCost, fSalvage, fLife, i, fFactor);

            if ( i == nLoopStart+1 )
                fTerm *= ( min( fEnd, fIntStart + 1.0 ) - fStart );
            else if ( i == nLoopEnd )
                fTerm *= ( fEnd + 1.0 - fIntEnd );

            fVdb += fTerm;
        }
    }
    else
    {
        double fPart = 0.0;
        if ( !approx_equal( fStart, fIntStart ) ||
             !approx_equal( fEnd, fIntEnd ) )
        {
            if ( !approx_equal( fStart, fIntStart ) )
            {
                double fTempIntEnd = fIntStart + 1.0;
                double fTempValue = fCost -
                    ScInterVDB( fCost, fSalvage, fLife, fLife, fIntStart, fFactor );
                fPart += ( fStart - fIntStart ) *
                    ScInterVDB( fTempValue, fSalvage, fLife, fLife - fIntStart,
                    fTempIntEnd - fIntStart, fFactor);
            }
            if ( !approx_equal( fEnd, fIntEnd ) )
            {
                double fTempIntStart = fIntEnd - 1.0;
                double fTempValue = fCost -
                    ScInterVDB( fCost, fSalvage, fLife, fLife, fTempIntStart, fFactor );
                fPart += ( fIntEnd - fEnd ) *
                    ScInterVDB( fTempValue, fSalvage, fLife, fLife - fTempIntStart,
                    fIntEnd - fTempIntStart, fFactor);
            }
        }
        fCost -= ScInterVDB( fCost, fSalvage, fLife, fLife, fIntStart, fFactor );
        fVdb = ScInterVDB( fCost, fSalvage, fLife, fLife - fIntStart,
            fIntEnd - fIntStart, fFactor);
        fVdb -= fPart;
    }
    return fVdb;
}
