Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Liutauras Vilda
Paul Clapham
Sheriffs:
paul wheaton
Tim Cooke
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Piet Souris
Bartenders:
Mike London
Forum:
Beginning Java
calculate bitwise according on human relativity
gong tji
Ranch Hand
Posts: 97
posted 1 year ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello everyone,
When I learning dart lang I find some bitwise operator , (
https://www.javatpoint.com/dart-operators
)
void main(){ print("Example of Bitwise operators"); var a = 25; var b = 20; var c = 0; // Bitwise AND Operator print("a & b = ${a&b}"); // Bitwise OR Operator print("a | b = ${a|b}"); // Bitwise XOR print("a ^ b = ${a^b}"); // Complement Operator print("~a = ${(~a)}"); // Binary left shift Operator c = a <<2; print("c<<1= ${c}"); // Binary right shift Operator c = a >>2; print("c>>1= ${c}"); }
Q
:
why the results are :
a & b = 16 a | b = 29 a ^ b = 13 ~a = 4294967270 c<<1= 100 c>>1= 6
how to calculate bitwise?
please someone help me
Thanks
Junilu Lacar
Sheriff
Posts: 17416
300
I like...
posted 1 year ago
Number of slices to send:
Optional 'thank-you' note:
Send
Read this:
https://en.m.wikipedia.org/wiki/Bitwise_operation
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Java BitWise and BitShifting operators
Syntax java
XOR
polymorphism, and order for bitwise operators
Bit shifting question
More...