Difference between revisions of "Documentation/How Tos/Calc: RAND function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(See also:)
m (Robot: Automated text replacement %s)
Line 19: Line 19:
 
: returns a random real number between <tt>'''a'''</tt> and <tt>'''b'''</tt>.
 
: returns a random real number between <tt>'''a'''</tt> and <tt>'''b'''</tt>.
  
=== See also: ===
+
{{Documentation/SeeAlso|
'''[[Documentation/How_Tos/Calc: RANDBETWEEN function|RANDBETWEEN]]'''
+
* [[Documentation/How_Tos/Calc: RANDBETWEEN function|RANDBETWEEN]]'''
  
'''[[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]'''
+
* [[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]'''
  
[[Documentation/How_Tos/Calc: Functions listed alphabetically|'''Functions listed alphabetically''']],
+
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
[[Documentation/How_Tos/Calc: Functions listed by category|'''Functions listed by category''']]
+
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}

Revision as of 14:14, 25 February 2009


RAND

Returns a random number between 0 and 1.

Syntax:

RAND()

This function produces a new random number each time Calc recalculates, greater than or equal to 0, and less than 1.
To force Calc to recalculate manually press Shift+Ctrl+F9.
To generate a random number which never recalculates, copy a cell containing =RAND(), and use Edit - Paste Special... (with Paste All and Formulas not selected and Numbers selected).

Example:

RAND()

returns a random number between 0 (inclusive) and 1 (exclusive).

RAND()*(b-a) + a

returns a random real number between a and b.

Template:Documentation/SeeAlso

Personal tools