Question:
Does double data type operands can not be used with bit wise operators in Java ?
Fly_high
2010-05-18 04:52:14 UTC
i m learning java language. i was taught that bit wise operators acts with long, int, short, char and byte data types but they said nothing about the double data type, does double data type can not be use with bit wise operators, then why it can not be used with bit wise operators. please somebody answer
Five answers:
deonejuan
2010-05-18 05:54:14 UTC
If you have played with ANSI C, you would know you need a register size -- aka a buffer. You push the binary bits back and forth with bitwise and the rules in Java take over so you never have a buffer overflow. Type float and type double use a double register to track the floating point of the decimal value. Bitwise works only with the single register. If a type is smaller than int, the type is promoted to int before the operator performs a bit shift.



Don't assume you have 32 slots unless your initial value is a negative int. For example, -4 is 1111 1111 1111 1111 1111 1111 1111 1100. But +4 is 1100, the pre-pended zeros are dropped.
augustowski
2016-10-07 04:15:46 UTC
Java Bit Shift
?
2010-05-18 05:06:19 UTC
No, they can't be used. The compiler will complain: "The operator << is undefined for the argument type(s) double, int".



I assume this is to do the problem of the stuff after the decimal points, given floats also won't allow bitshifting operations to be performed on them.
2016-11-05 11:57:47 UTC
whats up bitting could be very complicated with considered one of those good form of variteties yet 1st i could say get his the teeth checked via a qualified dentist. ask hem what they think of roughly his mouth confomation. is the pallet shallow? does he have a huge tongue? do his bars look comfortable? those form of could have a significant impact on the bit that he could be wearing. i can not permit you recognize what bit to apply without seeing him, and seeing him ridden. i'm going to assert this, the bits which you have chosen (different than the eggbutt) are extremly harsh. if he has comfortable bars (the hollow of the teeth the place the bit could take a seat) this could purely aggrivate the situation. eggbutt snaffles are famously many times going on as a form selection. this relies upon on mouth conformation. if he has a extensive it could have a nutcracker action, pincing the tongue and making is sore. if he has a shallow pallet, the joint will puah against the pallet. stick your finger on your mouth and push against the pallet (roof of mouth), ouch! hurts does not it? if he has the two vast tongue and shallow pallet than a single jointed bit is incorrect for him. the significant to bitting is to be as easy as a probability. pulling and placing against the bit isn't continually undesirable behaviour yet could be linked to discomfort and avasion. try a double linked bit like the french link. a unfastened ring will supply extra play and the thinner the bar of bit the harsher it somewhat is. so if he's not struggling with try a thinner one. whether, often bitting problems, somewhat whilst solid bits are regarded as needed are many times as a results of riders palms. each rider in spite of how solid desires consistent education and education. we owe this to our horses. sympathetic palms that supply a consistant touch would be much less probable to reason problems. a horse will purely pull in case you permit it. you're able to be applying 0.5 halts besides as 0.5 halts interior your seat so as that the breaks do not purely come out of your palms. i began out education my friends horse who replaced into wearing a hackermore, i replaced into advised she hates the bit. i never rode her in something yet a french link and never had the slightest problems together with her. whether, as a professional i nonetheless settle for the will for ongoing education as all of us slip back into undesirable behavior. solid success
?
2010-05-18 05:06:02 UTC
'Double' is a 8 byte double precision floating point. It gives precision upto 15 digits.therefore a float is sufficient for normal uses. Double is used for large numbers for high precision such as for astronomy or sub atomic physics.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...