81
rated 0 times
[
84]
[
3]
/ answers: 1 / hits: 16230
/ 10 Years ago, sun, march 30, 2014, 12:00:00
When I use Math.sin(90) for calculating Sine of 90 degrees in javascript it returns 0.8939966636005565, but sin(90) is 1. Is there a way to fix that? I need accurate values for any angle.
<!DOCTYPE html>
<html>
<body>
<p id=demo>Click the button calculate value of 90 degrees.</p>
<button onclick=myFunction()>Try it</button>
<script>
function myFunction(){
document.getElementById(demo).innerHTML=Math.sin(90);
}
</script>
More From » math