code: public static double blackScholesDigitalOptionDelta(
  			double initialStockValue,
  			double riskFreeRate,
  			double volatility,
  			double optionMaturity,
  			double optionStrike)
  	{
  		if(optionStrike <= 0.0 || optionMaturity <= 0.0)
  		{
  			// The Black-Scholes model does not consider it being an option
  			return 0.0;
  		}
  		else
  		{
  			// Calculate delta
  			double dPlus = (Math.log(initialStockValue / optionStrike) + (riskFreeRate + 0.5 * volatility * volatility) * optionMaturity) / (volatility * Math.sqrt(optionMaturity));
  			double dMinus = dPlus - volatility * Math.sqrt(optionMaturity);
  
  			double delta = Math.exp(-0.5*dMinus*dMinus) / (Math.sqrt(2.0 * Math.PI * optionMaturity) * initialStockValue * volatility);
  
  			return delta;
  		}
  	}
docs: Calculates the delta of a digital option under a Black-Scholes model
  
  @param initialStockValue The initial value of the underlying, i.e., the spot.
  @param riskFreeRate The risk free rate of the bank account numerarie.
  @param volatility The Black-Scholes volatility.
  @param optionMaturity The option maturity T.
  @param optionStrike The option strike.
  @return The delta of the digital option