2016年1月9日土曜日

Why don't programming languages define division by zero as zero?

Why don't programming languages define division by zero as zero?

Mathematics may not have a defined value for division by zero and that may have far-reaching philosophical consequences within that field of thought, but for most software applications, none of that matters. Is there a reason within computer science why simply defining 0/0=0 for a programming language would be more problematic than all the custom code that needs to get written to handle division by zero errors?
7 Answers
Matthew Mirman
Matthew Mirman, I'm a programmer. Deal with it.
360 Views
People don't only do approximative "I don't care if this really works" math using computers. They do things that matter, like manage money, control airplanes, program heart surgery robots, design bridges, write libraries or compilers which will get used by people who will be doing the above.

You shouldn't be dividing by something that could be zero in most applications. If you do, there is often a bug in your code. Letting it slide introduces even harder to find bugs. A tenant of good programming is to attempt to catch bugs as close to their introduction as possible.
Written Aug 27, 2013 • View Upvotes
More Answers Below. Related Questions
Programming Languages: Why don't the programming languages support GUI itself?
C++ (programming language): What are the features of C++ which most programmers don't know?
BASIC (programming language): Why don't companies/startups use BASIC to write their software?
Java (programming language): I am 21 and new to programming. I am learning Java at the moment but I don't get it easily like the rest of the class. Is it too late for me?
Programming Languages: Is the Main() method predefined or user-defined?
Thomas Dalton
Thomas Dalton
749 Views • Upvoted by Justin Rising, experienced programmer and software engineer
Division by zero in general is definitely not zero - it is more like infinity. You seem to be talking just about 0/0 specifically, which is different.

The appropriate value for 0/0 can be anything depending on the context (for example, if the 0/0 has resulted from substituting x=0 into x/x, it would be best to call that 1 so the function is continuous). In some cases, it would be appropriate to call it zero, but not always. That's why the programmer needs to handle it manually rather than the computer trying to guess what it should be.
Written Aug 28, 2013 • View Upvotes
Joseph Wang
Joseph Wang, Chief Scientist, Bitquant Research
199 Views • Joseph has 80+ answers in Computer Programming.
Yes it does matter. If nothing else, then the fact that you are dividing zero by zero likely says that you have a bug in your program.

There are two ways that computer programs handle 0/0, and this is usually configurable

1) 0/0 = NaN (not a number). For the purposes of most software, NaN is treated like any other number. If you really want to set 0/0 to zero you can wrong 

c = a/b
if (c == NaN) c= 0;

2) throw an exception. At which point you can trap the exception or let the computer program fail. This is important when you have a situation in which 0/0 just shouldn't happen.
Written Aug 28, 2013 • View Upvotes
Jack Menendez
Jack Menendez, I've been a programmer since 1976.
189 Views
Thee are two basic kinds of error checking in programming. The first is pre-runtime checking, which is done before the program can be run by a compiler and the second is run-time error checking, which is done while the program is running. Runtime errors come in two categories: program or soft errors and hard machine errors. Program or soft errors are caught internally by the program or its execution environment. Hard errors or machine errors are caught by the machine's hardware, the CPU. 

The error you are talking about, divide by 0, can be caught and flagged by any of the above mechanisms. 

Ultimately, the machine must catch these errors because it cannot make an assumption about what programming language or execution environment it is running. A program written in assembly language has none of the protections mentioned above except the machine itself. Computers are mathematical machines and divide by 0 is undefined in Boolean algebra which defines the machines hardware logic and the machine is designed to react accordingly.
Written Aug 28, 2013 • View Upvotes
Clifford Meyer
Clifford Meyer, Independent Author
217 Views
I was taught that undefined results, such as division by zero resulting in a not-a-number (NAN) value, had to be thrown or trapped because they can't ever be a valid result in the real world, and the programmer, and by extension the user of the application, can take take appropriate action. 

I can feel an old IBM mainframe ABEND (abnormal end of execution) coming on.
Written Aug 27, 2013 • View Upvotes
Anushka Ved
Anushka Ved, Crazy Programmer
142 Views
It is mathematically incorrect in a way that will affect real life.

Lets take a simple example: 

You are calculating Throughput(T) of machine using Output Quantity(OQ) in grams and Input Quantity(IQ) in grams based on this formula:

T = OQ/ IQ

Now take a case:

OQ=1000 and IQ=0.1
T=10000

Now say, you get to rounded off input so, your IQ=0

if language does divide by 0 as 0 your T will be : 0!!!!!

So, by the simple difference of 0.1 your throughput is dropping to 0, without knowing that this is erroneous. 

Even the infinite value would have been a better answer, as the machine is giving high OQ for relatively low IQ

That's why programming languages raise an exception, so that you at least know something is not right and you can avoid rounded off inputs if you are dividing.

I hope this answers your question
Written Aug 28, 2013 • View Upvotes
Anonymous
Anonymous
292 Views
Because defining it so will never make it mathematically correct!
Written Aug 27, 2013 • View Upvotes
Related Questions
Java (programming language): Where are the numbers defined in Java?
Programming Language Design: How is 'generality' defined based on various language design constructs?
Why do array indexes start with 0 (zero) in many programming languages?
Haskell (programming language): Why isn't yesod the django or rails of Haskell?
C# (programming language): Why won't Microsoft hire a few solid developers from node.js / Python / Ruby community and make Mono a fully open and officially supported ver...
Why don't most programming languages allow you to define your own syntax?
Programming Languages: Which programming languages should I learn?
Apple Swift (programming language): Why aren't values able to be implicitly converted to another type?
Java (programming language): What is the return type in: public List> invokeAll(Collection> tasks) ?
Java (programming language): I have a single dimensional array [1,2,3,4,5,6,7,8,9] in Java. I want to convert it two dimensional array with [1,3,6] in first row, [2,5,8] i...
Python (programming language): Why doesn't Python have "either" as a boolean operator?
C# (programming language): How do I create a thread for a function which belongs to a class different from the one in which the function creating the thread is a member ...
Should array indices start at 0 or 1?
Programming Languages: Is Self programming language dead?
Python (programming language): What are some cool Python tricks?https://www.quora.com/Why-dont-programming-languages-define-division-by-zero-as-zero


再生核研究所声明222(2015.4.8)日本の代表的な数学として  ゼロ除算の研究の推進を求める

ゼロ除算の成果は 2015.3.23 明治大学で開催された日本数学会で(プログラムは5200部印刷、インターネットで公開)、海外約200名に経過と成果の発表を予告して 正規に公開された。簡単な解説記事も約200部学会で配布された。インターネットを用いて1年以上も広く国際的に議論していて、骨格の論文も出版後1年以上も経過していることもあり、成果と経過は一応の諒解が広く得られたと考えても良いと判断される。経過などについては 次の一連の声明を参照:

再生核研究所声明148(2014.2.12) 100/0=0, 0/0=0 - 割り算の考えを自然に拡張すると ― 神の意志
再生核研究所声明154(2014.4.22) 新しい世界、ゼロで割る、奇妙な世界、考え方
再生核研究所声明157(2014.5.8) 知りたい 神の意志、ゼロで割る、どうして 無限遠点と原点が一致しているのか?
再生核研究所声明161(2014.5.30) ゼロ除算から学ぶ、数学の精神 と 真理の追究
再生核研究所声明163(2014.6.17) ゼロで割る(零除算)- 堪らなく楽しい数学、探そう零除算 ― 愛好サークルの提案
再生核研究所声明166(2014.6.20) ゼロで割る(ゼロ除算)から学ぶ 世界観
再生核研究所声明171(2014.7.30) 掛け算の意味と割り算の意味 ― ゼロ除算100/0=0は自明である?
再生核研究所声明176(2014.8.9) ゼロ除算について、数学教育の変更を提案する
Announcement 179 (2014.8.25): Division by zero is clear as z/0=0 and it is fundamental in mathematics
Announcement 185 : The importance of the division by zero $z/0=0$
再生核研究所声明188(2014.12.15) ゼロで割る(ゼロ除算)から観えてきた世界
再生核研究所声明190(2014.12.24)
再生核研究所からの贈り物 ― ゼロ除算100/0=0, 0/0=0
再生核研究所声明192(2014.12.27) 無限遠点から観る、人生、世界
夜明け、新世界、再生核研究所 年頭声明
― 再生核研究所声明193(2015.1.1)― 
再生核研究所声明194(2015.1.2) 大きなイプシロン(無限小)、創造性の不思議
再生核研究所声明195(2015.1.3) ゼロ除算に於ける高橋の一意性定理について
再生核研究所声明196(2015.1.4) ゼロ除算に於ける山根の解釈100= 0x0について
再生核研究所声明200(2015.1.16) ゼロ除算と複素解析の現状 ―佐藤超関数論との関係が鍵か?
再生核研究所声明202(2015.2.2) ゼロ除算100/0=0,0/0=0誕生1周年記念声明 ― ゼロ除算の現状と期待
再生核研究所声明215(2015.3.11) ゼロ除算の教え

日本の数学が、欧米先進国のレベルに達していることは、国際研究環境の実情を見ても広く認められる。しかしながら、初等教育から大学学部レベルの基本的な数学において 日本の貢献は 残念ながら特に見当たらないと言わざるを得ない。これは日本の数学が 大衆レベルでは 世界に貢献していないことを意味する。これについて 関孝和の微積分や行列式の発見が想起されるが、世界の数学史に具体的な影響、貢献ができなかったこともあって 関孝和の天才的な業績は 残念ながら国際的に認知されているとは言えない。
そこで、基本的なゼロ除算、すなわち、四則演算において ゼロで割れないとされてきたことが、何でもゼロで割れば ゼロであるとの基本的な結果は、世界の数学界における 日本の数学の顕著なものとして 世界に定着させる 良い題材ではないだろうか。
内容の焦点としてはまず:
ゼロ除算の発見、
道脇方式によるゼロ除算の意味付け、除算の定義、
高橋のゼロ除算の一意性、
衝突における山根の現象の解釈、
の4点が挙げられる。
6歳の道脇愛羽さんが、ゼロ除算は 除算の固有の意味から自明であると述べられていることからも分かるように、ゼロ除算は、ピタゴラスの定理を超えた基本的な結果であると考えられる。
ゼロ除算の研究の発展は 日本の代表的な数学である 佐藤の超関数の理論と密接な関係にあり(再生核研究所声明200)、他方、欧米では Aristotélēs の世界観、universe は連続である との偏見に陥っている現状がある。 最後にゼロ除算の意義 に述べられているように ゼロ除算の研究は 日本の数学として発展させる絶好の分野であると考えられる。 そこで、広く関係者に研究の推進と結果の重要性についての理解と協力を求めたい。
ゼロ除算の意義:
1)西暦628年インドでゼロが記録されて以来 ゼロで割るの問題 に 簡明で、決定的な解 1/0=0, 0/0=0をもたらしたこと。
2) ゼロ除算の導入で、四則演算 加減乗除において ゼロでは 割れない の例外から、例外なく四則演算が可能である という 美しい四則演算の構造が確立されたこと。
3)2千年以上前に ユークリッドによって確立した、平面の概念に対して、おおよそ200年前に非ユークリッド幾何学が出現し、特に楕円型非ユークリッド幾何学ではユークリッド平面に対して、無限遠点の概念がうまれ、特に立体射影で、原点上に球をおけば、 原点ゼロが 南極に、無限遠点が 北極に対応する点として 複素解析学では 100年以上も定説とされてきた。それが、無限遠点は 数では、無限ではなくて、実はゼロが対応するという驚嘆すべき世界観をもたらした。
4)ゼロ除算は ニュートンの万有引力の法則における、2点間の距離がゼロの場合における新しい解釈、 独楽(コマ)の中心における角速度の不連続性の解釈、衝突などの不連続性を説明する数学になっている。ゼロ除算は アインシュタインの理論でも重要な問題になっていたとされている。数多く存在する物理法則を記述する方程式にゼロ除算が現れているが、それらに新解釈を与える道が拓かれた。
5)複素解析学では、1次変換の美しい性質が、ゼロ除算の導入によって、任意の1次変換は 全複素平面を全複素平面に1対1 onto に写すという美しい性質に変わるが、 極である1点において不連続性が現れ、ゼロ除算は、無限を 数から排除する数学になっている。
6)ゼロ除算は、不可能であるという立場であったから、ゼロで割る事を 本質的に考えてこなかったので、ゼロ除算で、分母がゼロである場合も考えるという、未知の新世界、新数学、研究課題が出現した。
7)複素解析学への影響は 未知の分野で、専門家の分野になるが、解析関数の孤立特異点での性質について新しいことが導かれる。典型的な定理は、どんな解析関数の孤立特異点でも、解析関数は 孤立特異点で、有限な確定値をとる である。佐藤の超関数の理論などへの応用がある。
8)特異積分におけるアダマールの有限部分や、コーシーの主値積分は、弾性体やクラック、破壊理論など広い世界で、自然現象を記述するのに用いられている。面白いのは 積分が、もともと有限部分と発散部分に分けられ、 極限は 無限たす、有限量の形になっていて、積分は 実は、普通の積分ではなく、そこに現れる有限量を便宜的に表わしている。ところが、その有限量が実は、 ゼロ除算にいう、 解析関数の孤立特異点での 確定値に成っていること。いわゆる、主値に対する解釈を与えている。これはゼロ除算の結果が、広く、自然現象を記述していることを示している。
9)中学生や高校生にも十分理解できる基本的な結果をもたらした:
基本的な関数y = 1/x のグラフは、原点で ゼロである;すなわち、 1/0=0 である。
10)既に述べてきたように 道脇方式は ゼロ除算の結果100/0=0, 0/0=0および分数の定義、割り算の定義に、小学生でも理解できる新しい概念を与えている。多くの教科書、学術書を変更させる大きな影響を与える。

11)ゼロ除算が可能であるか否かの議論について:

現在 インターネット上の情報でも 世間でも、ゼロ除算は 不可能であるとの情報が多い。それは、割り算は 掛け算の逆であるという、前提に議論しているからである。それは、そのような立場では、勿論 正しいことである。出来ないという議論では、できないから、更には考えられず、その議論は、不可能のゆえに 終わりになってしまう ― もはや 展開の道は閉ざされている。しかるに、ゼロ除算が 可能であるとの考え方は、それでは、どのような理論が 展開できるのかの未知の分野が望めて、大いに期待できる世界が拓かれる。

12)ゼロ除算は、数学ばかりではなく、 人生観、世界観や文化に大きな影響を与える。
次を参照:

再生核研究所声明166(2014.6.20)ゼロで割る(ゼロ除算)から学ぶ 世界観
再生核研究所声明188(2014.12.16)ゼロで割る(ゼロ除算)から観えてきた世界

ゼロ除算における新現象、驚きとは Aristotélēs の世界観、universe は連続である を否定して、強力な不連続性を universe の現象として受け入れることである。

以 上

ゼロの発見には大きく分けると二つの事が在ると言われています。
一つは数学的に、位取りが出来るということ。今一つは、哲学的に無い状態が在るという事実を知ること。http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1462816269


1+0=1 1ー0=0 1×0=0  では、1/0・・・・・・・・・幾つでしょうか。
0???  本当に大丈夫ですか・・・・・0×0=1で矛盾になりませんか・・・・
割り算を掛け算の逆だと定義した人は、誰でしょう???
まして、10個のリンゴを0人で分けた際に、取り分 が∞個の小さな部分が取り分は、どう考えてもおかしい・・・・
受け取る人がいないわけですから、取り分は0ではないでしょうか。 すなわち何でも0で割れば、0が正しいのではないでしょうか。じゃあ聞くけど、∞個は、どれだけですか???

小学校以上で、最も知られている数学の結果は何でしょうか・・・
ゼロ除算(1/0=0)は、ピタゴラスの定理(a2 + b2 = c2 )を超えた基本的な結果であると考えられる。
https://www.pinterest.com/pin/234468724326618408/

もし1+1=2を否定するならば、どのような方法があると思いますか? http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q12153951522 #知恵袋_
一つの無限と一つの∞を足したら、一つの無限で、二つの無限にはなりません。



Title page of Leonhard Euler, Vollständige Anleitung zur Algebra, Vol. 1 (edition of 1771, first published in 1770), and p. 34 from Article 83, where Euler explains why a number divided by zero gives infinity.
https://notevenpast.org/dividing-nothing/

割り算のできる人には、どんなことも難しくない

世の中には多くのむずかしいものがあるが、加減乗除の四則演算ほどむずかしいものはほかにない。

ベーダ・ヴェネラビリス

数学名言集:ヴィルチェンコ編:松野武 山崎昇 訳大竹出版1989年

1/0=∞ (これは、今の複素解析学) 1/0=0 (これは、新しい数学で、Division by Zero)

原点を中心とする単位円に関する原点の鏡像は、どこにあるのでしょうか・・・・
∞ では無限遠点はどこにあるのでしょうか・・・・・

 加(+)・減(-)・乗(×)・除(÷) 除法(じょほう、英: division)とは、乗法の逆演算・・・・間違いの元 乗(×)は、加(+) 除(÷)は、減(-)
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1411588849/a37209195?sort=1&fr=chie_my_notice_canso

数学で「A÷0」(ゼロで割る)がダメな理由を教えてください。 http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1411588849 #知恵袋_

0×0=0・・・・・・・・・だから0で割れないと考えた。
唯根拠もなしに、出鱈目に言っている人は世に多い。

http://www.mirun.sctv.jp/~suugaku/%E5%A0%AA%E3%82%89%E3%81%AA%E3%81%8F%E6%A5%BD%E3%81%97%E3%81%84%E6%95%B0%E5%AD%A615.5.htm

世界中で、ゼロ除算は 不可能 か 
可能とすれば ∞  だと考えられていたが・・・
しかし、ゼロ除算 はいつでも可能で、解は いつでもセロであるという意外な結果が得られた。

無限遠点は存在するが、無限大という数は存在しない・・・・

天動説・・・・・・∞
地動説・・・・・・0

1÷0=0 1÷0=∞・・・・数ではない 1÷0=不定・未定義・・・・狭い考え方をすれば、できない人にはできないが、できる人にはできる。

『ゼロをめぐる衝突は、哲学、科学、数学、宗教の土台を揺るがす争いだった』 ⇒ http://ameblo.jp/syoshinoris/entry-12089827553.html … … →ゼロ除算(100/0=0, 0/0=0)が、当たり前だと最初に言った人は誰でしょうか・・・ 1+1=2が当たり前のように、

ゼロ除算(100/0=0, 0/0=0)が、当たり前だと最初に言った人は誰でしょうか・・・・ 1+1=2が当たり前のように
何とゼロ除算は、可能になるだろうと April 12, 2011 に 公に 予想されていたことを 発見した。

多くの数学で できないが、できるようになってきた経緯から述べられたものである。


Dividing by Nothing
by Alberto Martinez
It is well known that you cannot divide a number by zero. Math teachers write, for example, 24 ÷ 0 = undefined.

After all, other operations that seemed impossible for centuries, such as subtracting a greater number from a lesser, or taking roots of negative numbers, are now common. In mathematics, sometimes the impossible becomes possible, often with good reason.

Posted April 12, 2011More Discoverhttps://notevenpast.org/dividing-nothing/

アラビア数字の伝来と洋算 - tcp-ip
明治5年(1872)
http://www.tcp-ip.or.jp/~n01/math/arabic_number.pdf

地球平面説→地球球体説
天動説→地動説
1/0=∞若しくは未定義 →1/0=0
地球人はどうして、ゼロ除算1300年以上もできなかったのか?  2015.7.24.9:10 意外に地球人は知能が低いのでは? 仲間争いや、公害で自滅するかも。 生態系では、人類が がん細胞であった とならないとも 限らないのでは?

ビッグバン宇宙論と定常宇宙論について、http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1243254887 #知恵袋_


ゼロ除算の証明・図|ysaitoh|note(ノート) https://note.mu/ysaitoh/n/n2e5fef564997

Q)ピラミッドの高さを無限に高くしたら体積はどうなるでしょうか??? A)答えは何と0です。 ゼロ除算の結果です。

ゼロ除算は1+1より優しいです。 何でも0で割れば、0ですから、簡単で美しいです。 1+1=2は 変なのが出てくるので難しいですね。

∞÷0はいくつですか・・・・・・・

∞とはなんですか・・・・・・・・

分からないものは考えられません・・・・・

宇宙消滅説:宇宙が、どんどんドン 拡大を続けると やがて 突然初めの段階 すなわち 0に戻るのではないだろうか。 ゼロ除算は、そのような事を言っているように思われる。 2015年12月3日 10:38









0 件のコメント:

コメントを投稿