Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:x64 (Score 1) 179

I guess that answers my question. You don't write code which is why you think it's possible to write bug free software. Even if it is for one perfect person, I can assure you there are plenty of programmers who write buggy shit. I have to deal with them from time to time. I never said it was impossible to mix signed and unsigned. I said it was annoying to me personally and bad programming practice on a large scale.

Comment Re:x64 (Score 1) 179

Do you even write programs? The GNU C++ compiler will give you a warning if you compare a signed variable to an unsigned variable. This should tell you that it is a bad idea if you don't believe me. These 2 variables should both be signed or both be unsigned. If you make the score an unsigned value, then everything you compare it to should also be unsigned. Everything you add to it, multiply it by should also be unsigned. This is annoying with heavily used variables as you cannot use comparison to -1 to indicate an error has occurred as the value will never actually be negative...because, it's unsigned. 2's complement is nice in that it allows us to use signed variables with unsigned variables, but that doesn't mean we should. A variable is not a constant. Obviously, I wouldn't compare signed -1 to unsigned 5 if I knew that was the value of the variables. If you wrote complex software, you would realize that variables are not always in the correct range. That's one cause of software bugs. There are ways around it, but they involve speed trade offs. Every time I wanted to use a signed value to modify or compare to the score, I would have to first check to make sure it's not negative.
I understand 2's complement, but it really doesn't have anything to do with the reason signed and unsigned don't mix well in programs. Terms mean different things to different people depending on context. I explained my definition of sign bit in my previous post to clear your confusion about what I was saying. Apparently, the current definition in wikipedia agrees with me, so I am not the only one. Maybe you could edit the page and enlighten everyone?

Comment Re:x64 (Score 1) 179

2s complement
The most significant bit is 0, so the pattern represents a non-negative (positive) value....The most significant bit is 1, so the value represented is negative...
I call that a sign bit. I didn't say it was the bits of 1 with a sign bit of 1 to represent -1. -1 is actually all of the bits set to 1.
Since you didn't look that up, I know you didn't read my other post in this thread in reply to someone else.
If you compare an unsigned value to a negative signed value, you get the result that the signed value is usually greater than the unsigned value. i.e. 3 > -5 Also, if you accidently add 3 and -5 and store it in an unsigned variable, you get a very large number instead of "invalid value".

Comment Re:x64 (Score 1) 179

You still don't understand. A computer only knows how to compare bits and C++ does not automatically convert -1 to "invalid value" when you compare it to an unsigned int. You can compare unsigned int to POSITIVE signed ints. The trouble is when your signed int is NEGATIVE. The compiler just sees it as a really big positive number. So if you have unsigned int a = 5. And signed int b = -1. Even though the result is positive and small, you will get a = a + b = really big number. AND b > a will be true which is not what you might expect.

Comment Re:x64 (Score 1) 179

I'm going to use a 4 bit number just to simplify things. Compare 15 (1111 unsigned) to -1 (1111 signed). The answer is they are equal. You can see a similar problem with addition. There is no problem if you are 100% sure both numbers will always be positive. The problem only occurs when the signed number is an actual negative number. You can never be 100% sure of anything in a nontrivial program. It makes debugging a nightmare, especially in group programming, when signed and unsigned variables are mixed. You take away the possibility of checking for an error by comparing a score calculation to 0. Even if a value should never be less than 0, a mistake somewhere else may make it so. It's not a good idea to use unsigned values because it masks this error. When I say you can use all unsigned values, I mean on the same programming line, not the entire program (my bad). If you keep your signed and unsigned values on separate lines of code and don't mix them in the same comparison or math operation, you are fine. This is also annoying in large programs.

Comment Re:x64 (Score 1) 179

The leading bit on signed numbers is the actual sign. The leading bit on unsigned numbers is part of the number. Even if you store them both as twos complement, you have an extra bit which is interpreted differently depending on whether or not it is signed. How can you say that makes them exactly the same? How can they be stored exactly the same, yet give different ranges of values for the same number of bytes? I just didn't want to explain the entire thing figuring a lot of people didn't really need the explanation.

Comment Re:x64 (Score 1) 179

Not sure what language the game was written in, but I have a lot of problems when I used unsigned ints in C++. You cannot mix signed and unsigned ints or you get weird results when doing comparisons and basic math operations. It has to do with how the number is stored in memory (for the non-programmers). Limiting yourself to only unsigned numbers in a program is usually an annoyance.

Comment Re:Here's my question (Score 2, Interesting) 128

Yes, they are a corporation, but there's more to it than that. If you accept this settlement, Comcast is NOT admitting guilt. They are still innocent in the eyes of the law. They are offering you a bribe to drop the suit. You can legally do this in any civil case when you are suing for damages. If the parties settle their differences out of court, the court really cannot say that Comcast did not pay enough if no one objects. The real winners in all this is the lawyers. $3 million to them. IANAL

Comment Re:Free Public Colleges (Score 1) 419

You are talking about out of state fees. I am talking about a local college which is the whole premise of my point. I think most states have at least one public university. University of Central Florida has a good reputation for their Computer Science program, so I was a little more lucky. Their average yearly tuition is only $4,518 (http://finaid.ucf.edu/applying/app_costs.html). Sunny, the school you mentioned is $4,970 (http://www.albany.edu/financialaid/costs.shtml) which isn't much more. Plus I started out at a community college which is also an important point. It saves you a lot of money and employers don't really care where you spent your first 2 years. All of the methods I used are available to most of high school students. The problem is motivation. I see kids in college all of the time take their education for granted because their parents are footing the bill. It's just one big party to them. If someone has to work for what they get, they take their classes more seriously.

Comment Re:A couple of points (Score 1) 419

I majored in Computer Science. I had to take a test to get into the math classes and all highschool got me was Intermediate Algebra. Then I had to take College Algebra, then Trigonometry, then I skipped Pre-calculus because I was sick of taking courses that really did not count towards my degree. Calculus I is where they expect you to be at the beginning when you get into college for Computer Science.

Comment Re:Free Public Colleges (Score 1) 419

College (in the US) is practically free as long as you go to school locally. Living expenses is where most of your financial issues come from. When in elementary, middle and high school, your parents pay for your living expenses. Sometimes, parents can't or won't do that after you turn 18. If you have a nice college near you like I did, tuition and books are not that hard to cover. Community college starts are cheap. Then you have programs like Florida Bright Futures (yes, that requires good grades) that pay for tuition. If you didn't have good grades in school, you can always get loans that you don't pay while in college. If your parents don't make much or if you support yourself, you can get government grants. Also, even if you have to pay for school with loans, you can get almost all of the money back on your tax return as I did. This requires that you work while in school, but I did it for awhile on a job with McDonalds. Later, I got a paid internship through the school that was more money than fast food. The part of my loans that I did not cover is an interest rate of only 2.25% (requires consolidation) and repayment is income based. If I can't pay it off in 25 years, it is written off. It's different for every situation, but I started out as lower middle class (family of 5 living off of $30k/yr) and paid my own way through college. That's actually more difficult than someone from below the poverty level because they qualify for more government help.

Comment I call it... (Score 1) 408

Seems to me like a lot of hype with no actual website and suspiciously close to April 1st. I call April fools joke. All you can do is put your email into the main page to be "notified" when they go live. I say you get a nice April fool's email instead :) Still, it has been funny reading all the comments on multiple sites of people disgusted by the idea.

Slashdot Top Deals

Nobody said computers were going to be polite.

Working...