Wiris

Documentation / CalcMe

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • WirisQuizzes

      • LearningLemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Wiris Integrations

                        • Home
                        • CalcMe
                        • Basic guide to CalcMe
                        • Basic guide to CalcMe

                        Randomness

                        Reading time: 1min

                        Nota

                        As you may use these commands to generate an algorithm for a WirisQuizzes question, we show how to create them through the sheet and using the code editor. You can see more details about it here.

                        The random function in CalcMe is adaptable to many cases of use. For example, you will see how to remove the "0" from a random selection. The normal command would be like:

                        CalcMe sheet CalcMe code editor

                        By default, this includes all of the numbers between -10 and 10. If given the requirements of the question, the number 0 needs to be excluded from the set, you can remove it with one simple instruction:

                        CalcMe sheet CalcMe code editor

                        You have to add brackets around the first list for this to work. This can, of course, work equally for any other number you need to exclude other than zero:

                        CalcMe sheet CalcMe code editor

                        The above would produce a random number between -10 and 10, except the number 8. You can even do this with more than one number:

                        CalcMe sheet CalcMe code editor

                        This would remove 8,-8, and 0 from the selection. As you can see, there are many more options when creating a random variable. So far, you have retrieved integer numbers, but you can also work with real numbers.

                        CalcMe sheet CalcMe code editor

                        As a general rule, these real numbers will have as many decimal or significant figures as defined in the Application settings. You can adjust it by defining the step between the possible random values.

                        CalcMe sheet CalcMe code editor
                        CalcMe sheet CalcMe code editor

                        Atenció

                        As you may have seen, we can use {} and [] to exclude several numbers for the set of possible values when generating random variables. We use each of them as follows:

                        [] define arrays and matrices (arrays are supposed to contain the same data types).

                        {} define lists (lists can have different data types).

                        The random function can exclude values as long as the two parameters you pass are in the same format. In other words, if you include a list as a first parameter, you should pass a list as the second parameter as well.

                        Was this article helpful?

                        Give feedback about this article

                        Related Articles

                        • Basic guide to CalcMe
                        • Arithmetic
                        • Statistics
                        • Probability
                        • Combinatorics

                        Randomness

                        Nota Atenció

                        Empowering STEM education

                        MathType

                        • Office Tools
                        • LMS
                        • XML
                        • HTML

                        WirisQuizzes

                        Learning Lemur

                        Integrations

                        Solutions

                        • Education
                        • Publishing houses – platforms and interactive
                        • Publishing houses – Print and digital
                        • Technical writers

                        Pricing

                        Downloads

                        Blog

                        • Success stories

                        About us

                        • Careers
                        • Partnership

                        Contact Us

                        Contact Sales

                        European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                        • Cookie Policy
                        • Terms of Use
                        • Privacy Policy / GDPR
                        • Student Data Privacy
                        • Compliance
                        • Cookie Settings

                        © Wiris 2026

                        Expand