而js并不会报错,会输出Infinity:无穷
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>进击的巨人--JS</title>
<script>
document.write("<h1>算术运算符的用法:</h1>");
document.write("3+6="+(3+6)+" <br>");
document.write("3-6="+(3-6)+" <br>");
document.write("3*6="+(3*6)+" <br>");
document.write("1/0="+(1/0)+" <br>"); //Infinity:无穷
document.write("55%3="+(55%3)+" <br>");
var a=b=c=d=3;
document.write(a+"++结果是:"+(a++)+"<br/>");
document.write("++"+b+"结果是:"+(++b)+"<br/>");
document.write(c+"--结果是:"+(c--)+"<br/>");
document.write("--"+d+"结果是:"+(--d)+"<br/>");
</script>
</head>
<body>
</body>
</html> 二老师又写错了~,多写了个'u' 交作业~
<!DOCTYPE html>
<html>
<head>
<title>算术运算符</title>
</head>
<body>
<script type="text/javascript">
document.write('3+6='+(3+6)+'<br />');
document.write('3-6='+(3-6)+'<br />');
document.write('3*6='+(3*6)+'<br />');
document.write('3/6='+(3/6)+'<br />');
document.write('3%6='+(3%6)+'<br />');
var a=4
document.write('a++结果是'+(a++)+'<br />');
document.write('++a'+'结果是'+(++a)+'<br />');
document.write('a--结果是'+(a--)+'<br />');
document.write('--a'+'结果是'+(--a)+'<br />');
</script>
</body>
</html>
交作业~
<!DOCTYPE html>
<html>
<head>
<title>算术运算符</title>
</head>
<body>
<script type="text/javascript">
document.write('3+6='+(3+6)+'<br />');
document.write('3-6='+(3-6)+'<br />');
document.write('3*6='+(3*6)+'<br />');
document.write('3/6='+(3/6)+'<br />');
document.write('3%6='+(3%6)+'<br />');
var a=4
document.write('a++结果是'+(a++)+'<br />');
document.write('++a'+'结果是'+(++a)+'<br />');
document.write('a--结果是'+(a--)+'<br />');
document.write('--a'+'结果是'+(--a)+'<br />');
</script>
</body>
</html>
这破浏览器卡住了,提交了3次!{:10_277:} @不二如是
开始的doucument,多了一个u {:5_91:} Infinity 正无穷
document.write('打印括号中相关内容'){:10_297:}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>鱼C-算术运算符</title>
</head>
<body>
<script type="text/javascript">
document.write("<h1>算术运算符的用法:</h1>");
document.write("3+6="+(3+6)+" <br>");
document.write("3-6="+(3-6)+" <br>");
document.write("3*6="+(3*6)+" <br>");
document.write("1/0="+(1/0)+" <br>");
document.write("55%3="+(55%3)+" <br>");
var a=b=c=d=3;
document.write(a+"++结果是:"+(a++)+"<br/>");
document.write("++"+b+"结果是:"+(++b)+"<br/>");
document.write(c+"--结果是:"+(c--)+"<br/>");
document.write("--"+d+"结果是:"+(--d)+"<br/>");
</script>
</body>
</html> " "怎么用呐 学习了{:10_333:}。真奇妙,1/0 居然是取无穷大为结果,我还以为是NaN 非法值呢。不太好理解啊,理解为求极限吧。
页:
[1]