public double weightedStandardDeviation_as_double() {
		boolean hold = Stat.nFactorOptionS;
		if (nFactorReset) {
			if (nFactorOptionI) {
				Stat.nFactorOptionS = true;
			} else {
				Stat.nFactorOptionS = false;
			}
		}
		boolean holdW = Stat.weightingOptionS;
		if (weightingReset) {
			if (weightingOptionI) {
				Stat.weightingOptionS = true;
			} else {
				Stat.weightingOptionS = false;
			}
		}

		double varr = 0.0;
		if (!weightsSupplied) {
			System.out.println("weightedStandardDeviation_as_double: no weights supplied - unweighted value returned");
			varr = this.standardDeviation_as_double();
		} else {
			double variance = 0.0D;
			switch (type) {
			case 1:
				double[] dd = this.getArray_as_double();
				double[] ww = amWeights.getArray_as_double();
				variance = Stat.variance(dd, ww);
				break;
			case 12:
				BigDecimal[] bd = this.getArray_as_BigDecimal();
				BigDecimal[] wd = amWeights.getArray_as_BigDecimal();
				variance = (Stat.variance(bd, wd)).doubleValue();
				bd = null;
				wd = null;
				break;
			case 14:
				throw new IllegalArgumentException("Complex cannot be converted to double");
			default:
				throw new IllegalArgumentException("This type number, " + type + ", should not be possible here!!!!");
			}
			varr = Math.sqrt(variance);

		}
		Stat.nFactorOptionS = hold;
		Stat.weightingOptionS = holdW;
		return varr;
	}