i want Java program for additin of two numbers with out using any Arithemetic operator.
Addition program
Collapse
X
-
Tags: None
-
Why do you want such a program; I mean it will be highly inefficient comparedOriginally posted by Kakarla Durga Prasadi want Java program for additin of two numbers with out using any Arithemetic operator.
to a simple '+' operator.
kind regards,
JosComment
-
Originally posted by JosAHWhy do you want such a program; I mean it will be highly inefficient compared
to a simple '+' operator.
kind regards,
Jos
And the program doesn't even teach as much Java as you would want your students to learn from an assignment if you were a teacher.Comment
-
True, teachers either like to freak with bits or they come up with assignmentsOriginally posted by r035198xAnd the program doesn't even teach as much Java as you would want your students to learn from an assignment if you were a teacher.
using Swing components before the students can even design a couple of decent
classes. Or the ever boring CD inventory program of course ;-)
kind regards,
JosComment
-
Don't forget Rational numbers.Originally posted by JosAHTrue, teachers either like to freak with bits or they come up with assignments
using Swing components before the students can even design a couple of decent
classes. Or the ever boring CD inventory program of course ;-)
kind regards,
Jos
I have a feeling that if I take a Java class here at college, I'll come across the same problem.Comment
-
If you want to add rational (or real or even complex) numbers, you must still use the '+' operator or an alternative, which is capable of adding integers / doubles. Just have to write a bit more code.Originally posted by Ganon11Don't forget Rational numbers.
I have a feeling that if I take a Java class here at college, I'll come across the same problem.
There's a wonderful quote: "God created the positive integers. Everything else was created by man."
Greetings,
NepomukComment
-
I like the following corollary: "zero, one, more". Where 'more' may includeOriginally posted by nepomukThere's a wonderful quote: "God created the positive integers. Everything else was created by man."
integral numbers, rational numbers, real (IEE) numbers, complex numbers,
quaternions and even the number three.
kind regards,
Jos ;-)Comment
-
Well, zeros and ones are certainly anything a computer (and a mathematician, who goes back to the basics) needs... ^^Originally posted by JosAHI like the following corollary: "zero, one, more". Where 'more' may include
integral numbers, rational numbers, real (IEE) numbers, complex numbers,
quaternions and even the number three.
kind regards,
Jos ;-)
Greetings,
NepomukComment
-
Duh, you CS guys always overcomplicate things; us math type of folks onlyOriginally posted by nepomukWell, zeros and ones are certainly anything a computer (and a mathematician, who goes back to the basics) needs... ^^
Greetings,
Nepomuk
need an idempotent element and a successor function.
kind regards,
Jos ;-)Comment
-
Well, actually I'm also a math guy, but you will need neutral elements (0 and 1 ARE idempotent elements by the way, at least within the complex numbers and any subset of those) and, as r035198x pointed out, a few axioms. Just imagine, you couldn't expect "a + b = b + a"! (And yes, I do know, that you get such constructs, but they aren't much use in anything the OP might want to do, are they?)Originally posted by JosAHDuh, you CS guys always overcomplicate things; us math type of folks only
need an idempotent element and a successor function.
kind regards,
Jos ;-)
Greetings,
NepomukComment
-
Quick! Defenestrate this man! He's overcomplicatin g things again byOriginally posted by nepomukWell, actually I'm also a math guy, but you will need neutral elements (0 and 1 ARE idempotent elements by the way, at least within the complex numbers and any subset of those) and, as r035198x pointed out, a few axioms. Just imagine, you couldn't expect "a + b = b + a"! (And yes, I do know, that you get such constructs, but they aren't much use in anything the OP might want to do, are they?)
Greetings,
Nepomuk
re-rejargoning simple things! Help! Help! I'm being oppressed! Help!
kind regards,
Jos ;-)Comment
-
I'm not overcomplicatin g things, I'm just going back to the basics.Originally posted by JosAHQuick! Defenestrate this man! He's overcomplicatin g things again by
re-rejargoning simple things! Help! Help! I'm being oppressed! Help!
kind regards,
Jos ;-)
But hey, I managed to oppress JosAH? Wow, that makes me feel really good! ;-)
Feeling very much defenestrated,
NepomukComment
Comment