当我使用Math.sin(90)在javascript中计算90度的正弦时,它返回0.8939966636005565,但sin(90)是1.有没有办法解决这个问题?我需要任何角度的准确值.
<!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>
Run Code Online (Sandbox Code Playgroud)