Elementary mathematical functions and operations

You can view the binary representation of any number (integer or float) with the bits function, for example, bits(3) returns "0000000000000000000000000000000000000000000000000000000000000011".

To round a number, use the round() or iround() functions: the first returns a floating point number, and the last returns an integer. All standard mathematical functions are provided, such as sqrt(), cbrt(), exp(), log(), sin(), cos(), tan(), erf() (the error function), and many more (refer to the following URL). To generate a random number, use rand().

Use parentheses ( ) around expressions to enforce precedence. Chained assignments such as a = b = c = d = 1 are allowed. The assignments are evaluated right-to-left. ...

Get Getting Started with Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.