| 475 | } |
| 476 | |
| 477 | SIValue SIValue_Add(const SIValue a, const SIValue b) { |
| 478 | if(a.type == T_NULL || b.type == T_NULL) return SI_NullVal(); |
| 479 | if(a.type == T_ARRAY || b.type == T_ARRAY) return SIValue_ConcatList(a, b); |
| 480 | if(a.type == T_STRING || b.type == T_STRING) return SIValue_ConcatString(a, b); |
| 481 | /* Only construct an integer return if both operands are integers. */ |
| 482 | if(a.type & b.type & T_INT64) { |
| 483 | return SI_LongVal(a.longval + b.longval); |
| 484 | } |
| 485 | /* Return a double representation. */ |
| 486 | return SI_DoubleVal(SI_GET_NUMERIC(a) + SI_GET_NUMERIC(b)); |
| 487 | } |
| 488 | |
| 489 | SIValue SIValue_Subtract(const SIValue a, const SIValue b) { |
| 490 | /* Only construct an integer return if both operands are integers. */ |
no test coverage detected