We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39bf7e7 commit 74f769fCopy full SHA for 74f769f
src/scratch/value.h
@@ -239,6 +239,17 @@ class LIBSCRATCHCPP_EXPORT Value : public ValueVariant
239
*this = toDouble() / v.toDouble();
240
}
241
242
+ /*! Replaces the value with modulo of the value and the given value. */
243
+ inline void mod(const Value &v)
244
+ {
245
+ if ((v == 0) || (m_type == Type::Infinity || m_type == Type::NegativeInfinity))
246
+ m_type = Type::NaN;
247
+ else if (v.m_type == Type::Infinity || v.m_type == Type::NegativeInfinity) {
248
+ return;
249
+ }
250
+ *this = fmod(toDouble(), v.toDouble());
251
252
+
253
inline const Value &operator=(float v)
254
{
255
m_type = Type::Number;
0 commit comments