15d. Obiekt Math

JS Wynik działania
1. Stałe matematyczne
<script>
   document.write('e = '+ Math.E+'<br />');
   document.write('ln2 = '+Math.LN2+'<br />');
   document.write('ln10 = '+Math.LN10+'<br />');
   document.write('log2e = '+Math.LOG2E+'<br />');
   document.write('log10e = '+Math.LOG10E+'<br />');
   document.write('pi = '+Math.PI+'<br />');
   document.write('sqrt 1/2 = '+Math.SQRT1_2+'<br />');
   document.write('sqrt 2 = '+Math.SQRT2+'<br />');
</script>
2. abs
<script>
   document.write(Math.acos(10)+'<br />');
   document.write(Math.abs(-10)+'<br />');
</script>
3. acos 30° około 0,5235 radianów
<script>
   document.write(Math.acos(0.5235)+'<br />');
</script>
4. cos 30° około 0,5235 radianów
<script>
   document.write(Math.cos(0.5235)+'<br />');
</script>
5. sin 30° około 0,5235 radianów
<script>
   document.write(Math.sin(0.5235)+'<br />');
</script>
6. asin 30° około 0,5235 radianów
<script>
   document.write(Math.asin(0.5235)+'<br />');
</script>
7. tan 30° około 0,5235 radianów
<script>
   document.write(Math.tan(0.5235)+'<br />');
</script>
8. atan 30° około 0,5235 radianów
<script>
   document.write(Math.atan(0.5235)+'<br />');
</script>
9. atan2
<script>
   document.write(Math.atan2(1,1)+'<br />');
</script>
10. ceil
<script>
   document.write(Math.ceil(1.1)+'<br />');
   document.write(Math.ceil(1.5)+'<br />');
   document.write(Math.ceil(1.7)+'<br />');
</script>
11. floor
<script>
   document.write(Math.floor(1.1)+'<br />');
   document.write(Math.floor(1.5)+'<br />');
   document.write(Math.floor(1.7)+'<br />');
</script>
12. round
<script>
   document.write(Math.round(1.1)+'<br />');
   document.write(Math.round(1.5)+'<br />');
   document.write(Math.round(1.7)+'<br />');
</script>
13. exp
<script>
   document.write(Math.exp(0)+'<br />');
   document.write(Math.exp(1)+'<br />');
   document.write(Math.exp(2)+'<br />');
</script>
14. log
<script>
   document.write(Math.log(0)+'<br />');
   document.write(Math.log(1)+'<br />');
   document.write(Math.log(Math.E)+'<br />');
   document.write(Math.log(8)+'<br />');
</script>
15. max i min
<script>
   document.write(Math.max(100, 1, 2, 6, -5)+'<br />');
   document.write(Math.min(100, 1, 2, 6, -5)+'<br />');
</script>
16. random
<script>
   document.write(Math.random()+'<br />');
   document.write(Math.ceil(Math.random()*100+100)+'<br />');
</script>
17. pow
<script>
   document.write(Math.pow(2,0)+'<br />');
   document.write(Math.pow(2,1)+'<br />');
   document.write(Math.pow(2,3)+'<br />');
   document.write(Math.pow(2,6)+'<br />');
</script>
18. sqrt
<script>
   document.write(Math.sqrt(2)+'<br />');
   document.write(Math.sqrt(4)+'<br />');
   document.write(Math.sqrt(9)+'<br />');
   document.write(Math.sqrt(12)+'<br />');
</script>
19. pierwiastki wyższych stopni (obejście problemu)
<script>
   document.write(Math.pow(27, 1/3)+'<br />');
   document.write(Math.pow(9, 1/2)+'<br />');
   document.write(Math.pow(3125, 1/5)+'<br />');
</script>