* xmlXPathSubValues: * @ctxt: the XPath Parser context * * Implement the subtraction operation on XPath objects: * The numeric operators convert their operands to numbers as if * by calling the number function. */
| 6448 | * by calling the number function. |
| 6449 | */ |
| 6450 | void |
| 6451 | xmlXPathSubValues(xmlXPathParserContextPtr ctxt) { |
| 6452 | xmlXPathObjectPtr arg; |
| 6453 | double val; |
| 6454 | |
| 6455 | arg = valuePop(ctxt); |
| 6456 | if (arg == NULL) |
| 6457 | XP_ERROR(XPATH_INVALID_OPERAND); |
| 6458 | val = xmlXPathCastToNumberInternal(ctxt, arg); |
| 6459 | xmlXPathReleaseObject(ctxt->context, arg); |
| 6460 | CAST_TO_NUMBER; |
| 6461 | CHECK_TYPE(XPATH_NUMBER); |
| 6462 | ctxt->value->floatval -= val; |
| 6463 | } |
| 6464 | |
| 6465 | /** |
| 6466 | * xmlXPathMultValues: |
no test coverage detected