Other functions
Help Contents
Logo and Mathematics
Mathematical functions (guide)
Other functions
Other functions
Except for the funcitions decribed above, there are few others that cannot be categorized.
Pi is a function without arguments. You can use it to get a precise value of the mathematical constant p.
print pi ; 3.14159265358979
For many simulations you would like to have random numbers. There is such a function in Logo which returns a random number whenever you call it.
This function is random and can be used with or without an argument.
If there is no argument random returns a random number from 0 to 1.
If there is argument N then the result is a random number from 0 to N that could not be integer.
In both cases the random number can be equal to the 0, but can never be the same as the upper limit of the possible range.
print random ; 0.346296521136537
print random ; 0.175248484592885
print random 100 ; 98.8024020334706
print random 100 ; 60.4138494469225
References: