1
$\begingroup$

I have the following section of code I am writing for research. Basically I need to formally represent the mathematical notation behind a set that follows:

for (int i = 1; i < h; i++)
    if (h % i == 0)
        // i is part of the set

I am not very familiar with formal mathematical notation, and was wondering if anyone can help me express this.

Thanks

$\endgroup$
0
$\begingroup$

The set could be specified like this: $S = \{i : (1 \leq i < h) \land (h ~\%~ i = 0)\}$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.