Register to reply 
How does one become proficient in programming? 
Share this thread: 
#20
Jul1711, 09:02 AM

HW Helper
P: 7,035

A bit off topic, maybe this should be split off into a separate thread.



#21
Jul1711, 09:56 AM

PF Gold
P: 6,122

My belief, and I have not yet verified this, is that when you convert some numbers from decimal to binary and then do the division in binary, you do can get an infiinite nonrepeating binary real number. I doesn't SOUND logical, now that I think about it and perhaps when I did 16/10 as 10000/1010 I didn't carry it out far enough (or it might have been 14/10 as 1110/1010, I can't remember whether both of them seemed irrational in binary or just one of them. Guess I'm now going to have to do the math. GADS I HATE doing long division in binary, but in this case, I KNOW you can't get the computer to do it for you because it doesn't have enough bits, so it gets to a rounding error which is the point I was making in the post I referred to. LATER: OK, I didn't go very far w/ the long division in binary (horrible stuff) but I'm convinced you are correct, as you logically MUST be. The problem of 1.4+2.6 not being equal to 4.0 in computers has nothing to do with the rationality of the number in one system or the other, it just has to do with the fact that when you do the division in binary you have to truncate before adding so you get a rounding error. As I pointed out in the other thread, the decimalbased computer's equivalent of this is that 1/3 + 2/3 is not equal to 1.0 because when you put them into floating point representation you get (I'm going to assume a 10digit memory) .3333333333 + .6666666666 which comes out to .9999999999 so the equality doesn't work. Thanks for pointing out my mistake about the rationality. 


#22
Jul1711, 01:54 PM

P: 128

Given that, I know for a fact that there are numbers which can be represented accurately in a finite string of digits in one number system, while requiring a representation with repeating digits in another. (I just can't think of any examples in binary right now) 


#23
Jul1711, 02:12 PM

PF Gold
P: 6,122




#24
Jul1711, 03:46 PM

HW Helper
P: 7,035

This is a niche part of programming, still thinking it belongs in another thread.



#25
Jul1711, 10:28 PM

P: 133

The way you put this makes you sound like you're so sure of yourself, which is exacerbated by how wrong you are. Honestly, it's pretty insulting... 


#26
Jul1711, 10:40 PM

P: 133

First, please read your claim of knowledge above. Can you see how it's irrelevant? According to your quote, irrational numbers "cannot be represented as terminating or repeating decimals," emphasis being mine. While a number may be represented with a finite number of digits in one system and a repeating set of digits in another, this doesn't change whether that number is irrational or not... Secondly, please take care to quote in context: It seems to me that you're referring to an "informal" definition. While these informal descriptions can aid in understanding, I wouldn't rely on them as evidence as much as you do... 


#27
Jul1711, 11:42 PM

HW Helper
P: 7,035

http://en.wikipedia.org/wiki/IEEE_7542008 For most computers integers are stored as 32 bit or 64 bit signed binary numbers, although some computers support larger integers. How the data is stored isn't that important for programming proficiency. There a lot of different types of programming, business, scientific, operating systems, data base, web site design, embedded code for peripherals or consumer devices that have computers in them, ... . Many students and engineers find MatLab to be helpful, although it's more like a mathematical tool as opposed to a programming language. There's still a large amount of legacy like scientific code still being written in Fortran. C and C++ are popular for a lot of types of programming. You didn't mention what aspect of programming you like. As mentioned in prevoius posts, most jobs involve specializing in one type of programming. The main issue for learning programming is finding a good set of tasks to implement for the learning experience. Even if you don't take a class, getting the assignments from a class to implement programs yourself can be useful, but you made need help if you run into issues. I'm not sure what book to recommend these days. 


#28
Jul1811, 12:45 AM

PF Gold
P: 194

The mathematical reason floating point numbers behave as they do on computers has nothing to do with binary; instead, it is due to the inability of processors to work with fractions. So when you ask the computer to store 1/3, it does the calculation as 1 divided by 3 in decimal notation. So the computer winds up with .33333333> and is truncated to a certain precision. If an operation such as 3 * (1/3) is performed, the computer takes .333333333 and times it by 3 to arrive at .9999999999. But its still a rational number because it repeats. For example.... the .333333333 can be expressed as a fraction by taking 33 (the pattern) and dividing by 99. The .999999999 can be expressed as fraction with 99/99. Irrational numbers, like PI, are always irrational. There are no patterns. 


Register to reply 
Related Discussions  
Recommended programming language (and texts) for middleschool beginner programming  Programming & Computer Science  9  
Physics proficient?  Academic Guidance  2  
Doing OO programming the right way  Programming & Computer Science  17  
Programming a PIC  Programming & Computer Science  21  
Programming language to make a forum  Computing & Technology  10 