please tell me java code to add two numbers with using bitwise operators only? can we write the program in java OS is linux, java5.0 version
10 3535
please tell me java code to add two numbers with using bitwise operators only? can we write the program in java OS is linux, java5.0 version
Even without if-statements or the likes? Only bit-operations? Why not just use the + operator?
please tell me java code to add two numbers with using bitwise operators only? can we write the program in java OS is linux, java5.0 version
You might give it a try by googling for "bitwise Horsmeier" *ahem*. That twit
can't write one normal readable statement; everything he types is unreadable,
terse, cryptic gibberish.
kind regards,
Jos ;-)
You might give it a try by googling for "bitwise Horsmeier" ...
Bit-voodoo!
; )
......
Bit-voodoo!
; )
......
I agree; that guy is a nutcase.
kind regards,
Jos ;-)
I agree; that guy is a nutcase.
kind regards,
Jos ;-)
Oh, no doubt about it!
; )
Oh, no doubt about it!
; )
Ok, so we both agree on that; case closed; *grmph*
kind regards,
Jos ;-)
Ok, so we both agree on that; case closed; *grmph*
kind regards,
Jos ;-)
My mother always warned me not to disagree with mathematicians!
; )
I disagree of course.
Everything is binary.
please tell me java code to add two numbers with using bitwise operators only? can we write the program in java OS is linux, java5.0 version
Hi
The bitwise operator will convert your binary number in to equivalent binary number after that it will add the numbers using binary addition norms. and then will convert in to equivalent decimal number. The result will be different from your mathematical addition.
Hi
The bitwise operator will convert your binary number in to equivalent binary number after that it will add the numbers using binary addition norms. and then will convert in to equivalent decimal number. The result will be different from your mathematical addition.
Well, I'd say the algorithm used for the addition is incorrect then. When I'd add
the numbers 23 and 19 I'd expect 42 and nothing else, no matter the radix of
the representation of the number.
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mike Hodkin |
last post by:
As a beginning student of C++, books reference "bitwise operators" and give
brief examples, but I have not read a good explanation of what they are used
for. One reference mentioned that they are...
|
by: August Derleth |
last post by:
Cause I made such a hash of my first attempt, and in an effort to provide
PORTABLE code to solve the problem, I submit this solution to convert to
and from BCD values stored in longs. This should...
|
by: noridotjabi |
last post by:
I'm learning to program in C and any tutorial or book that I read likes
to briefly touch on birdies operators and then move on without giving
any sort of example application of them. Call me what...
|
by: CptDondo |
last post by:
I'm working with some legacy C code. Apparently the author didn't know
or care about the difference between int, int16_t, unsigned int, and so
on. He does a lot of bitwise |, &, etc on signed...
|
by: elsa |
last post by:
hi..
im trying to build a program using arrays to do the following things:
1- convert a digital number to binary using mathematical operators by using the function void...
|
by: sudha30 |
last post by:
hi please find code to add two numbers only by using bitwise operators
|
by: mahi543 |
last post by:
can we write a program in java using bitwise operators to add two numbers
|
by: r035198x |
last post by:
Setting up.
Getting started
To get started with java, one must download and install a version of Sun's JDK (Java Development Kit).
The newest release at the time of writting this article is...
|
by: Jeff.Goldfinkle |
last post by:
Hi All
Is there a simple way to twiddle the bits of a float? In particular, I
would like to round my float to the n most significant bits.
For example - 0.123 in binary is 0.000111111...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: 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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |