MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / AR_MODULO

Function AR_MODULO

src/arithmetic/numeric_funcs/numeric_funcs.c:51–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51SIValue AR_MODULO(SIValue *argv, int argc, void *private_data) {
52 if(SIValue_IsNull(argv[0]) || SIValue_IsNull(argv[1])) return SI_NullVal();
53
54 // check for modulo by zero e.g. n % 0
55 if((SI_TYPE(argv[0]) & SI_TYPE(argv[1]) & T_INT64) && SI_GET_NUMERIC(argv[1]) == 0) {
56 Error_DivisionByZero();
57 return SI_NullVal();
58 }
59 return SIValue_Modulo(argv[0], argv[1]);
60}
61
62/* TODO All AR_* functions need to emit appropriate failures when provided
63 * with arguments of invalid types and handle multiple arguments. */

Callers

nothing calls this directly

Calls 4

SIValue_IsNullFunction · 0.85
SI_NullValFunction · 0.85
Error_DivisionByZeroFunction · 0.85
SIValue_ModuloFunction · 0.85

Tested by

no test coverage detected