i want Java program for additin of two numbers with out using any Arithemetic operator.
13 5163
i want Java program for additin of two numbers with out using any Arithemetic operator.
We can't help you cheat by doing your homework for you.
i want Java program for additin of two numbers with out using any Arithemetic operator.
Why do you want such a program; I mean it will be highly inefficient compared
to a simple '+' operator.
kind regards,
Jos
Why 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.
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.
True, 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
True, 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
Don'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.
Don'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.
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.
There's a wonderful quote: "God created the positive integers. Everything else was created by man."
Greetings,
Nepomuk
There's a wonderful quote: "God created the positive integers. Everything else was created by man."
I 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 ;-)
I 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 ;-)
Well, zeros and ones are certainly anything a computer (and a mathematician, who goes back to the basics) needs... ^^
Greetings,
Nepomuk
Well, zeros and ones are certainly anything a computer (and a mathematician, who goes back to the basics) needs... ^^
Greetings,
Nepomuk
Duh, you CS guys always overcomplicate things; us math type of folks only
need an idempotent element and a successor function.
kind regards,
Jos ;-)
Duh, you CS guys always overcomplicate things; us math type of folks only
need an idempotent element and a successor function.
kind regards,
Jos ;-)
And a few ridiculous axioms ...
Duh, you CS guys always overcomplicate things; us math type of folks only
need an idempotent element and a successor function.
kind regards,
Jos ;-)
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?)
Greetings,
Nepomuk
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?)
Greetings,
Nepomuk
Quick! Defenestrate this man! He's overcomplicating things again by
re-rejargoning simple things! Help! Help! I'm being oppressed! Help!
kind regards,
Jos ;-)
Quick! Defenestrate this man! He's overcomplicating things again by
re-rejargoning simple things! Help! Help! I'm being oppressed! Help!
kind regards,
Jos ;-)
I'm not overcomplicating things, I'm just going back to the basics.
But hey, I managed to oppress JosAH? Wow, that makes me feel really good! ;-)
Feeling very much defenestrated,
Nepomuk
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Zack Wahab |
last post by:
Hi,
I use Dev C++ compiler. Tried this program :
// Fig. 1.6: fig01_06.cpp
// Addition program.
#include <iostream>
// function main begins program execution
int main()
|
by: akickdoe22 |
last post by:
i could really use help finishing this addition program. I'm stuck on
the part that allows you to add any two large integers,up to 100
digits,(pos+pos, neg+neg, and pos+neg). could use hints ideas...
|
by: Alex Vinokur |
last post by:
Consider the following statement:
n+i, where i = 1 or 0.
Is there more fast method for computing n+i than direct computing that sum?
--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT...
|
by: snow.carriers |
last post by:
(This is personal work by the way, I took the questions from sites to
enhance my c++ at start before I go indepth)
A program will ask 10 questions in addition. If they get it wrong, they
get...
|
by: Andy |
last post by:
Hi,
Are 1 through 4 defined behaviors in C?
unsigned short i;
unsigned long li; /* 32-bit wide */
1. i = 65535 + 3;
2. i = 1 - 3;
3. li = (unsigned long)0xFFFFFFFF + 3;
4. li = 1...
|
by: confusedKaran |
last post by:
Hi,
I am currently making a program which can add and multiply two numbers with infinite amount of digits.
The addition part of it I did by taking the input as a string and then one by one addiing...
|
by: Mike |
last post by:
Hello All,
Please, if anyone can point me to the problem, I'd sure appreciate it!
I am very new to VB programming and not a programmer to begin with.
This is part of a Visual Basic 2005 Express...
|
by: hamady2001 |
last post by:
Hello everyone this is my first post and I just started my Python class. I am stuck on an assignment...please help
I have to redo the below program (from a prior assignment) to include 2 functions...
|
by: thirusvga |
last post by:
please send addition program....
|
by: susheela s |
last post by:
i wrote a program to add bytes in array in such a way that when i add zeroth byte of two array sum should retained and carry must be added to next addition of bytes(ie array index 1 bytes)
this is...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |