|
|
#1 | |
|
Baseband Member
Join Date: May 2010
Posts: 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...
Quote:
Thanks: Alex_tom
__________________
http://www.soniktechnologies.in/ http://www.samartha.net.in/ |
|
|
|
|
|
|
#2 |
|
Cheesoid
|
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. |
|
|
|
|
|
#3 |
|
ಠ_ಠ
Join Date: May 2009
Location: 'Murica!
Posts: 9,037
|
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.
__________________
Desktop: PII 955, 4GB DDR3 1333, M4A79T, 250GB 7200.10, HD 5770, 3x HG281D Laptop: Q9000, 4GB DDR3, DV7 mb, 40GB Hitachi, HD 4650M, 23" AOC LED backlit panel Netbook: Pink ASUS 1005HAB, Atom N270, 1GB DDR2, 160GB HDD, Intel 945G, 63 Whr battery |
|
|
|
|
|
#4 | |
|
Site Team
Join Date: Jul 2009
Posts: 2,627
|
Quote:
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. |
|
|
|
|
|
|
#5 |
|
Fully Optimized
|
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 |
|
|
|
|
|
#6 |
|
Site Team
Join Date: Mar 2004
Posts: 6,945
|
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." |
|
|
|
|
|
#7 | |
|
Baseband Member
Join Date: May 2010
Posts: 48
|
Quote:
Thanks sir !!! You can also arise more question relate with Zero [0] .
__________________
http://www.soniktechnologies.in/ http://www.samartha.net.in/ |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|