Previous Up Next

7.3.2  Standard arithmetic operators for real numbers

The +, -, *, /, and ^ operators are the usual infixed operators to do addition, subtraction, multiplication, division and raising to a power.

Examples

3+2
     
5           
3-2
     
1           
3*2
     
6           
3/2
     
3
2
          
3.2/2.1
     
1.52380952381           
3^2
     
9           
3.2^2.1
     
11.5031015682           
Remark.

Use the square key or the cube key if your keyboard has one; for example, 32 returns 9.

Remarks on non integral powers.

If x is not an integer, then ax=exln(a), hence if x is not rational, then ax is well-defined only for a>0. If x is rational and a<0, the principal branch of the logarithm is used, leading to a complex number. Note the difference between (a)1/n and a1/n when n is an odd integer.

Example

To draw the graph of y=∛x3x2, input:

plotfunc(ifte(x>0,(x^3-x^2)^(1/3),-(x^2-x^3)^(1/3)),x,xstep=0.01)

You might also input:

plotimplicit(y^3=x^3-x^2)

but this is much slower and much less accurate.


Previous Up Next