MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / operator%

Method operator%

src/Dynamic.cpp:520–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518
519
520double Dynamic::operator%(const Dynamic &inRHS) const
521{
522 if (mPtr->__GetType()==vtInt && inRHS.mPtr->__GetType()==vtInt)
523 return mPtr->__ToInt() % inRHS->__ToInt();
524 double lhs = mPtr->__ToDouble();
525 double rhs = inRHS->__ToDouble();
526 int even = (int)(lhs/rhs);
527 double remain = lhs - even * rhs;
528 if (remain<0) remain += fabs(rhs);
529 return remain;
530}
531
532hx::IndexRef Dynamic::operator[](int inIndex)
533{

Callers

nothing calls this directly

Calls 3

__GetTypeMethod · 0.45
__ToIntMethod · 0.45
__ToDoubleMethod · 0.45

Tested by

no test coverage detected