LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Closed Thread
  Search this Thread
Old 01-17-2010, 10:54 AM   #166
GoinEasy9
Member
 
Registered: Feb 2004
Location: Manorville, New York, USA
Distribution: siduction, openSUSE Tumbleweed
Posts: 379
Blog Entries: 1

Rep: Reputation: 47

Quote:
thread title -- what are you doing now ??

My answer...Simply unsubscribing from thread. this thread started some where... keep on going and going.... to infinite ( may be ).

bye to all subscribers.
Exactly what happens when you unsubscibe from infinity?? Has thoughts that he might have jumped ship while going through a wormhole.
 
Old 01-17-2010, 11:12 AM   #167
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by GrapefruiTgirl View Post
But, any number divided by itself, = 1 doesn't it?
That's true with any other number, but think:

0 x 0 = 0
0 x 1 = 0
0 x 2 = 0
...
 
Old 01-17-2010, 11:24 AM   #168
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,302
Blog Entries: 61

Rep: Reputation: Disabled
0/0 = 1
1/1 = 1
2/2 = 1
 
Old 01-17-2010, 11:32 AM   #169
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,199

Rep: Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387
Quote:
Originally Posted by brianL

0/0 = 1
Actually 0/0 is whats known as an indeterminate form, which means that whatever original equation you were working with can either be: factored to a more simple form before taking it's limit, or can be taken it's limit as is by using L'Hôpital's rule. Don't feel bad though, I am sure it has been ages since you have had Calculus.
 
Old 01-17-2010, 11:33 AM   #170
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Let's see how to divide. For example 10 / 2. You do this:

1 x 2 = 2
2 x 2 = 4
3 x 2 = 6
4 x 2 = 8
5 x 2 = 10

So the answer is 5. Now just try doing this with 0 / 0. You'll find that any answer works.
 
Old 01-17-2010, 11:40 AM   #171
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,302
Blog Entries: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by Jeebizz View Post
Actually 0/0 is whats known as an indeterminate form, which means that whatever original equation you were working with can either be: factored to a more simple form before taking it's limit, or can be taken it's limit as is by using L'Hôpital's rule. Don't feel bad though, I am sure it has been ages since you have had Calculus.
I don't think we actually did any calculus in what were then called "Secondary Modern" schools in the UK (way, way, back).
 
Old 01-17-2010, 11:43 AM   #172
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,199

Rep: Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387Reputation: 1387
Quote:
Originally Posted by MTK358

Now just try doing this with 0 / 0. You'll find that any answer works.
Perhaps you have had classes beyond Calculus (I have yet to take Discrete Maths, Linear Algebra), so maybe in courses beyond Calculus I you can actually use the indeterminate form, if so please explain.
 
Old 01-17-2010, 01:01 PM   #173
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Jeebizz View Post
Perhaps you have had classes beyond Calculus (I have yet to take Discrete Maths, Linear Algebra), so maybe in courses beyond Calculus I you can actually use the indeterminate form, if so please explain.
I actually don't know Calculus yet, that's just how I logically thought of it.
 
Old 01-17-2010, 01:22 PM   #174
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by MTK358 View Post
I actually don't know Calculus yet, that's just how I logically thought of it.
computer says 0/0 == 0.
 
Old 01-17-2010, 02:00 PM   #175
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
computer says 0/0 == 0
I just get "Math operation error" in the bottom status bar with gcalctool.

xcalc just gives "nan".

Are you using the Windows Calculator (I ask because I notice you're posting from Vista)? I could swear that even that one has a divide-by-zero error message...

IMO all calc progs should return "nan" or "divide by zero error" or some variation if the user attempts to divide by zero, regardless of what the dividend (divisor?) is.

Last edited by MrCode; 01-17-2010 at 02:45 PM. Reason: IMO...
 
Old 01-17-2010, 02:55 PM   #176
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by MrCode View Post
I just get "Math operation error" in the bottom status bar with gcalctool.

xcalc just gives "nan".

Are you using the Windows Calculator (I ask because I notice you're posting from Vista)? I could swear that even that one has a divide-by-zero error message...

IMO all calc progs should return "nan" or "divide by zero error" or some variation if the user attempts to divide by zero, regardless of what the dividend (divisor?) is.
Code:
echo void main(){printf("%d\n", 0/0);} > 0d0.c
gcc 0d0.c -o 0d0
should work on linux or windows with MingW.
 
Old 01-17-2010, 03:26 PM   #177
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Code:
bash-4.0$ cat test.c
#include <stdio.h>

int main() {
	printf("%d\n", 0/0);
}

bash-4.0$ gcc test.c -o 0d0
test.c: In function ‘main’:
test.c:4: warning: division by zero
I think most programs just look for division by zero and call it invalid no matter what.

Since the answer is undefined I doubt it would be useful in a program, anyway.
 
Old 01-17-2010, 03:26 PM   #178
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
Quote:
Originally Posted by smeezekitty View Post
Code:
echo void main(){printf("%d\n", 0/0);} > 0d0.c
gcc 0d0.c -o 0d0
should work on linux or windows with MingW.
Then your computer suck in math :P

After a copy-paste of your code i got both a warning during compilation, and a runtime-error while executing.
 
Old 01-17-2010, 03:30 PM   #179
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
The example doesn't include stdio.h (required for printf()), and it's a bad idea to use "void main()", instead use "int main()".
 
Old 01-17-2010, 03:57 PM   #180
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
I know, but smeezekitty claimed that this program would print 0
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration