Computer Forums Power of '0' [Zero]

06-03-2010, 12:18 AM   #1
Baseband Member

Join Date: May 2010
Posts: 48
Power of '0' [Zero]

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...

Quote:
 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
__________________

__________________
http://www.soniktechnologies.in/
http://www.samartha.net.in/

 06-03-2010, 03:28 AM #2 ~~~~~~~~   Join Date: Jan 2005 Location: Wales Posts: 5,556 Re: Power of '0' [Zero] 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. __________________ __________________
 06-03-2010, 01:43 PM #3 Omnicide now.     Join Date: May 2009 Location: My own personal hell Posts: 10,021 Re: Power of '0' [Zero] 1. You cannot divide by zero. It is not allowed in the definition of division. 2. 0 3. 0 4. Idk, I am not a programmer. __________________
06-03-2010, 06:26 PM   #4
Site Team

Join Date: Jul 2009
Location: England, UK
Posts: 3,434
Re: Power of '0' [Zero]

Quote:
 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!
__________________
Save the whales, feed the hungry, free the mallocs.

 06-03-2010, 07:03 PM #5 Fully Optimized     Join Date: Sep 2008 Posts: 1,604 Re: Power of '0' [Zero] 1) Can't divide anything by zero. 2) 0 3) 0 4) Lol. Can't answer that! __________________ XFIRE: Lindmando STEAM: Lindmando Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz (2 CPUs), ~3.0GHz 4094MB RAM 500 GB HD ATI Radeon™ HD 5850 8800 GT Windows 7 64-bit Ultimate
 06-16-2010, 02:01 PM #6 Site Team     Join Date: Mar 2004 Posts: 8,096 Re: Power of '0' [Zero] 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. __________________ I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
07-15-2010, 11:44 PM   #7
Baseband Member

Join Date: May 2010
Posts: 48
Re: Power of '0' [Zero]

Quote:
 Originally Posted by root 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] .
__________________

__________________
http://www.soniktechnologies.in/
http://www.samartha.net.in/