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
                        • Commands
                        • Programming Functions
                        • Programming Functions

                        Random

                        Reading time: 1min

                        Nota

                        Working with statistics? See Random (Statistics).

                        Returns a random number. One can specify the seed using random_seed(Integer).

                        Syntax

                        random()
                        
                        random(Integer)
                        
                        random(Real)
                        
                        random(Integer, Integer)
                        
                        random(Real, Real)
                        

                        Description

                        Returns a random number in the interval (0,1).

                        Given an integer n, returns a random integer number in the interval [0,n) (if n is positive) or (n,0] (if n is negative).

                        Given a real x, returns a random real number in the interval [0,x) (if x is positive) or (x,0] (if x is negative).

                        Given two integers numbers a and b, returns a random integer in the interval [a,b].

                        Given two real numbers a and b, returns a random real number in the interval [a,b].

                        Atenció

                        Given two integers numbers a and b, if a>b the result will be a random decimal number between b and a.

                        Was this article helpful?

                        Give feedback about this article

                        Related Articles

                        • Append
                        • Belongs?
                        • Complement
                        • Constant list
                        • Count element

                        Random

                        Nota Syntax Description 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