StringBuilder sb = new StringBuilder();
char operatorChar = mode == OutputFormat.LaTeX ? ' ' : '*';
if (factor.isReal() && factor.getReal().signum() < 0) {
sb.append('-');
Complex f = factor.abs();
if (!f.isOne())
sb.append(((Tensor) f).toString(mode, Product.class)).append(operatorChar);
} else if (factor != Complex.ONE)
sb.append(((Tensor) factor).toString(mode, Product.class)).append(operatorChar);
int i = 0, size = factor == Complex.ONE ? size() : size() - 1;