http://pastebin.ca/468287 In this, whats the difference between 0xFF & b, and just b * DJackScO (xenophobe@secure-team.admin.by.god-l1ke.de) has joined #java * DJackScO (xenophobe@secure-team.admin.by.god-l1ke.de) has left #java * dxus (nC_dxus@C22|dxus.users.quakenet.org) has joined #java * tSh|Kietz is now known as KIETZ aca20031, "0xFF & b" instead of just "b" seems redundant i figured it out, the byte can be signed (-1 to -128) "0xFF & b" simply masks off the lower 8 bits of b... but b is a byte and thus only is 8 bits in size so it has no affect unless b is -113 lol. * distepPerr (~kwkmq@bbnwebdproxy4.europe.hp.net) has joined #java $and(-113,255) [Eval ->] 143 signedness has nothing to do with it well change 0xFF & b to b and see what you get. And then tell me if there's any other thing you can think of besides signed bytes that would make the mdifferent -113 is 10001111. What's 10001111 & 11111111... just the same: 10001111 (those are binary by the way) System.out.println(-113 & 0xFF); * distepPerr (~kwkmq@bbnwebdproxy4.europe.hp.net) has left #java 143 * megabozz (~megabozz@c-71-195-158-164.hsd1.ma.comcast.net) Quit (Signed off) now try; byte b = -113: System.out.println(b & 0xFF); 143 ;) There is no println function that takes a byte there's one that takes an int and one that takes a char ... int > byte its a promotion so int is a valid pass * PagisoRhaeg (chief@84-246-89-170.rev.sth.ownit.se) has joined #java * PagisoRhaeg (chief@84-246-89-170.rev.sth.ownit.se) has left #java * Ranek` is now known as Ranek Apparantly the VM only manages 32 bit numbers, and so byte variables aren't really 8 bit numbers, they are masked ints. * Ranek` (~Ranek@Ranek.users.quakenet.org) has joined #java * sChBettMic (jopsuli@c-d688e253.04-404-7570701.cust.bredbandsbolaget.se) has joined #java * Ranek (~Ranek@Ranek.users.quakenet.org) Quit (Ping timeout) * sChBettMic (jopsuli@c-d688e253.04-404-7570701.cust.bredbandsbolaget.se) has left #java simple enough that when 10001111 isn't seen as a byte anymore (integer) it's no longer negative the first bit is put into play, 143 By the way, 143 isn't a valid byte value in Java. Bytes have a range of -128..127, so the code masks off the actual byte value and uses it as an integer, and automatically casting that to an integer converts it to an unsigned value obviously thats the point of removing the sign and passing it as an integer So the masking has nothing to do with the sign the question was why does it make a difference the answer is signed numbers are no longer their original value :P No, there is no "sign" removed. Java uses 2s complement. It's because the Java VM, as I explained already, uses 32-bit bytes, not real bytes im not being literal that the sign is just bumped off im saying any signed number becomes a positive integer after the comparison -127, 1000001 -> 129 what comparison? the bitwise comparison. what's a bitwise comparison? ... the & comparing against 11111111 in bit terms that's not a comparison operator, == is a comparison operator its still called a bitwise comparisong :x no it's not The AND operator (&) defines a bit-wise comparison between two variables according to the truth table shown in Table 3.4. ... yes, in the truth table each bit is compared to produce the resulting bit anyway I'm not interested in term legistic In fact, I get it now so none of this really matters :P My question was merely whats the difference in value the operator, however, is not a comparison - it is an operator whose result relies ON a comparison of each bit i dont give two poots what its called o.o well you should only what it does and what its result is :) in order to communicate effectively with other human beings, it generally helps if you know what things are called and not just what they do ;) Well good thing i no longer need to communicate on this subject, and no longer care whether people would prefer they be called 'bitwise operators' instead of 'bitwise comparison' it's not a matter of preference, it is a matter of correctness * [Wc]BenKj (~nix@a91-152-145-122.elisa-laajakaista.fi) has joined #java Personalized Results 1 - 10 of about 971,000 for bitwise operation. (0.26 seconds) Personalized Results 1 - 10 of about 632,000 for bitwise comparison. (0.31 seconds) You can forgive me :) /help &; & bitwise comparison * [Wc]BenKj (~nix@a91-152-145-122.elisa-laajakaista.fi) has left #java * DF|Laptop (Dataforce@home.dataforce.org.uk) has joined #java Yes, that's what it *does* That is not what it's *called* then "the bitwise comparison" wasnt an invalid sentence, because it is comparing the bits...wisely :) The & operator DOES a bitwise comparison it is not itself a comparator. == is a comparator and the == operator DOES a comparison too. they both DO comparisons. lol. * Ranek` is now known as Ranek yes they do and they are both operators, not comparisons == is the comparison OPERATOR & is the bitwise and OPERATOR I said "after the comparison" if they do a comparison then after the action, the comparison, is a valid sentence they DO comparison (in the case of the bitwise &, a bitwise comparison) if I add 1+1 and say "after the addition" its valid and if you did "1 == 1" and says "after the comparison", it would be valid we just agreed that both & and == DO comparisons however, if you did "1 & 1" then it would not be correct to say "after the comparison", but "after the bitwise &" which make the comparison the action which makes the sentence just as valid. no, you say the operator name, not the action. addition operator -> "after the addition". comparison operator -> "after the comparison". & operator -> "after the bitwise and", | -> "after the bitwise or" etc then why is it valid to say "after the comparison" for == and not "after the equals operators" because == is a comparison operator just like <, >, >=, <= and != and & COMPARES bits no it's AND's them < > >= <= != COMPARES objects and strings and ints .. .AND is so not a valid verb it's a bitwise AND operation, not a comparison and == is a EQUALS operator lol. equals is a comparison operator 01 & 11, compares 0 to 1, returns 0 compares 1 to 1, returns 1 * fukkiBcAg (~jani.kang@p5B079A05.dip0.t-ipconnect.de) has joined #java * megabozz (~megabozz@c-71-195-158-164.hsd1.ma.comcast.net) has joined #java internally it compares so fom the English non-elitest-jerk point of view & does not compare aca20031, actually the operator does no such thing "bitwise comparison" is a legit response it performs bitwise AND logically you can think of it as doing that, but there is no comparison done in actuality We're talking about sentences and names not uber-micro-management-differences * cheek (~cheek@dslb-082-083-085-236.pools.arcor-ip.net) Quit (Ping timeout) Actually, the more I think about it, I really dont care what the fuck you call the motehr fucking operator for fuck's sake! lol. if you don't believe us, google it I asked a question that really does not have anything to do with the names of the fucking operators no need to cuss, aca20031. Calm down Can we stop arguing over the minor facist crap. Stop throwing a temper tantrum and sit in the corner until you calm down psht. * fukkiBcAg (~jani.kang@p5B079A05.dip0.t-ipconnect.de) has left #java woozle. * IRBMe can make up words too Thanks for the "help" by the way. you're "welcome" "bye" now, have a "nice" "day" I asked what the difference between b and 0xFF & b was and got a lecture on nothing to do with that while I found my answer in a channel not even about java. thanks for the "recap" my "buffer" isn't "working" oh wait, it "is" so what are you trying to accomplish now? You're getting no point across except angering me, seems liek a pretty crappy point. I'm not making any points any more I'm not arguing that, when you get down to the small points you're right, sure you are Thanks for finally acknowledging that I'm saying that as an English sentence "after the comparison" does not invoke 50 lines of argument :x It takes two people to argue You're just as guilty as moi If you'd rather not waste more time on it, I suggest you stop replying now I have time to waste :) Then why are you bitching? Just don't really care to because I know I can get no where in a programing channel, generally the people are very micro-oriented Then why did you argue? unless something is 100% acurate based on how the computer itself handles binary data... :/ because I've seen thsi channel argue these small points with 50 different people And never get around to helping them I thought you didn't care didnt care about what I care about people joining and asking a simple quesiton like why "long num = 123" doesnt work You tell me, you're the one who just said "Just don't really care" and gfetting crap about "bigdecimal" and child porn... child porn? My, that is worrying Are you sure you're not just being spammed? was earlier. Really has nothing to do with you, just an annoying instance of someone not getting helped in this channel I felt I could bring up :) I suggest you take that up with an IRC operator then, and send them the hostmask of the culprit, as they may be infected with a bot or virus yeah...I doubt that. http://pastebin.ca/468250 Child pornography is quite a serious issue. You should perhaps contact the authorities about that too (19:34:58) well that works (19:34:59) ahhaha thanks (19:35:05) no problem problem solved quite quickly I answer him. answered* Amist the child porn talk and useless arguments thats my point -.- * SPScara[BFS (~Jarnagin@server.gibt.es.bei.netlayer.eu) has joined #java and again, it has nothing to do with this. I jsut pasted that so you wouldnt think, as you apparantly do, that im stupid enoguh to equate someone PMing me with a virus with child porn talk in #java So what's your point? Somebody asked a question and you answered, while there was a second conversation going on... AAAAAAAAAAAAAAAND? * Shanks\NA (Shanks@powered.by.bouncer24.de) has joined #java Anyway, remind me to never ask a "I want to learn" question in here again. * Shanks\NA (Shanks@powered.by.bouncer24.de) Quit (G-lined) I'll go back to my useless sit and answer what I can existence. "I want to learn" is a statement, not a question Oh that's cute. Satisfied now? You got me at what would appear to be a gramatical error, except for the fact that i used it as an adjective * dxus (nC_dxus@C22|dxus.users.quakenet.org) Quit (Ping timeout) Since i don't want to be banned, which is going to happen soon enough if this keeps up lol, no hard feelings assuming we dont have another argument :) I'm just going to quit talking now * SPScara[BFS (~Jarnagin@server.gibt.es.bei.netlayer.eu) has left #java ok bye It was a pleasure