javascripts中的数字系统 [英] Numbers System in javascripts

查看:45
本文介绍了javascripts中的数字系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

被零除在 JavaScript 中不是错误:它只是返回无穷大或负数无限.然而,有一个例外:零除以零并不能很好地-定义的值,此操作的结果是特殊的非数字值,打印作为 NaN .如果您尝试将无穷大除以无穷大,或者在 JavaScript 中取负数的根,或者使用带有非数字操作数的算术运算符,NaN 也会出现不能转换为数字.例如

Division by zero is not an error in JavaScript: it simply returns infinity or negative infinity. There is one exception, however: zero divided by zero does not have a well- defined value, and the result of this operation is the special not-a-number value, printed as NaN . NaN also arises if you attempt to divide infinity by infinity, or take the square in JavaScript root of a negative number or use arithmetic operators with non-numeric operands that cannot be converted to numbers. for Example

1. 0===0 returns True & 1==1 returns true

2. 0/0 returns NaN & 1/1 returns 1

零是数字,一也是数字?

Zero is Number and one is also a number?

我想要解释?为什么这仅在 JavaScript 中发生?

I want the explanation? Why this Exactly happens in JavaScript only?

推荐答案

在数学中,用数字字符 0 表示的零是两者:

In mathematics, zero, symbolized by the numeric character 0, is both:

  1. 在位置编号系统中,一个位置指示符,意思是没有这个倍数的单位".比如十进制数1041,千位有一个单位,百位没有单位,十位有四个单位,1-9位有一个单位.

  1. In a positional number system, a place indicator meaning "no units of this multiple." For example, in the decimal number 1,041, there is one unit in the thousands position, no units in the hundreds position, four units in the tens position, and one unit in the 1-9 position.

介于 +1 和 -1 之间的独立值.

An independent value midway between +1 and -1.

在数学之外的写作中,根据上下文,零的各种外延或内涵含义包括完全失败"、缺席"、零"和绝对没有".(无"是一个比零"更抽象的概念,它们的含义有时会交叉.)

In writing outside of mathematics, depending on the context, various denotative or connotative meanings for zero include "total failure," "absence," "nil," and "absolutely nothing." ("Nothing" is an even more abstract concept than "zero" and their meanings sometimes intersect.)

  1. Brahmagupta 将零的概念发展为一个实际的独立数字,而不仅仅是一个占位符,并编写了从其他数字中加减零的规则.印度的著作被传给了 al-Khwarizmi(我们从他的名字中获得了算法这个词),然后又传给了 Leonardo Fibonacci 和其他继续发展这个概念和数字的人.

点击链接这里

这篇关于javascripts中的数字系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆