Ejemplo n.º 1
0
    void PhpResultGenerator::generateAtom (StringBuffer& output, float value) const {
      output.appendText("d:");

      if (value == 0.0) {
        output.appendText("0.0", 3);
      }
      else if (isnormal(value)) {
        output.appendDecimal(value);
      }
      else {
        int a = isinf(value);

        if (a == -1) {
          output.appendText("-INF");
        }
        else if (a == 1) {
          output.appendText("INF");
        }
        else /* if (isnan(value)) */ {
          output.appendText("NAN");
        }
      }

      output.appendText(";");
    }
Ejemplo n.º 2
0
    void XmlResultGenerator::generateAtom (StringBuffer& output, float value) const {
      if (value == 0.0) {
        output.appendText("0.0", 3);
        return;
      }

      int intType = _fpclass(value);

      switch (intType) {
        case _FPCLASS_PN:
        case _FPCLASS_NN:
        case _FPCLASS_NZ:
        case _FPCLASS_PZ: {
          output.appendDecimal(value);
          break;
        }
        case _FPCLASS_NINF: {
          generateAtom(output, "-INF");
          break;
        }
        case _FPCLASS_PINF: {
          generateAtom(output, "INF");
          break;
        }
        default: {
          generateAtom(output, "NAN");
          break;
        }
      }
    }
Ejemplo n.º 3
0
ResultStatus CubeWorker::setCellValue(const string& areaIdentifier, const string& sessionIdentifier, const IdentifiersType& path, double value, SplashMode splashMode, bool addValue)
{
	StringBuffer sb;

	sb.appendText("DOUBLE;");
	sb.appendInteger(dbid);
	sb.appendChar(';');
	sb.appendInteger(cubeid);
	sb.appendChar(';');
	sb.appendText(StringUtils::escapeString(areaIdentifier));
	sb.appendChar(';');
	sb.appendText(StringUtils::escapeString(sessionIdentifier));
	sb.appendChar(';');
	sb.appendText(buildPathString(&path));
	sb.appendChar(';');
	sb.appendDecimal(value);
	sb.appendChar(';');
	sb.appendInteger(PaloJob::splashNumber(splashMode));
	sb.appendChar(';');
	sb.appendInteger((int)addValue);

	// we need to change the job-type
	//    dispatcher->downgradeCurrentJobs();

	// send set-cell-value request to worker
	vector<string> result;

	ResultStatus status = execute(sb.c_str(), result);

	if (status != RESULT_OK) {
		return status;
	}

	if (isErrorStatus(result)) {
		throw WorkerException(result[0].substr(6), true);
	} else if (isExceptionStatus(result)) {
		throw WorkerException(result[0].substr(10), true);
	}

	numFailures = 0;
	return RESULT_OK;
}
Ejemplo n.º 4
0
    void XmlResultGenerator::generateAtom (StringBuffer& output, double value) const {
      if (value == 0.0) {
        output.appendText("0.0", 3);
      }
      else if (isnormal(value)) {
        output.appendDecimal(value);
      }
      else {
        int a = isinf(value);

        if (a == -1) {
          generateAtom(output, "-INF");
        }
        else if (a == 1) {
          generateAtom(output, "INF");
        }
        else /* if (isnan(value)) */ {
          generateAtom(output, "NAN");
        }
      }
    }
Ejemplo n.º 5
0
void VariantDate::print (StringBuffer& buffer, size_t) const {
  buffer.appendText("(date) ");
  buffer.appendDecimal(getValue());
  buffer.appendEol();
}