Power of '0' [Zero]

Alex_tom

Baseband Member
Messages
48
Guy's I have good topic to discuss our Ideas and our knowledge. To I have a number that is '0' [Zero]. You can discuss about Zero here. Some basic Question...

What happen if we divide any thing by Zero?
What happen if we divide Zero by any thing?
What happen if we multiply Zero with any thing?
What is role of Zero in programming language?

Like this all of Question you want, you can discuss here. You can put a question here and also can give an answer.


Thanks:

Alex_tom
 
1. Maths breaks
2. You get zero
3. You get zero
4. I don't know enough about it to give a proper answer.

In fact, 1-3 might be totally wrong too.
 
What happen if we divide any thing by Zero?
What happen if we divide Zero by any thing?
What happen if we multiply Zero with any thing?
What is role of Zero in programming language?
The answer to 3) is the same in any programming language - you get 0! As is the answer to 2). There's no denying that.

The answer to the other two depends.

1) - Mathematically speaking, foothead is correct. However, many programming languages implement this in different ways - some even handle the situation differently in themselves! The two most common outcomes are either some form of error, or a result representing an invalid number.

Some languages like Java have both. Do the divison with integers and it'll throw an ArithmeticException at runtime. Do the division with floating point values and it'll run perfectly fine but return a NaN value (there's a good reason for this behaviour but that's beyond the scope of this post!)

Essentially, it's not defined mathematically so different languages make up different ways of dealing with the situation - since there's no standard they're not consistent. (As an aside, the same applies when using the modulo operator with negative numbers - this isn't allowed mathematically but lots of languages implement this, just differently! Another one to watch out for.) The important thing is knowing that it's inconsistent so you can check whenever you have to work around this issue.

4) - Again it depends on the language. 0 used to be used to signify pretty much everything that was empty, void, false, or erroneous. In C it's equivalent to false. In javascript / VBA it can be equivalent to null values. However - this isn't very descriptive and can cause confusion to both the machine and its user, so we're fortunately seeing a move away from this ambiguity. More modern languages like Java tend to reserve 0 to mean just that - 0. False is signified by false, null values are signified by null, and errors are signified by exceptions (or more generally, throwables.) So these days in many languages, the short answer to your question is that 0 tends to mean 0, just that and not a lot else!
 
1 as divisor tends to zero result tends to infinity.

2, 0

3, 0

4, as a number as a logic state, as an output, really depends on the language you're using.
 
1 as divisor tends to zero result tends to infinity.

2, 0

3, 0

4, as a number as a logic state, as an output, really depends on the language you're using.


Thanks sir !!! You can also arise more question relate with Zero [0] .
 
Back
Top Bottom