answersLogoWhite

0


Best Answer

Logic is a major aspect of mathematics, particularly boolean algebra. While it is possible to write programs using nothing more than elementary decimal arithmetic, you cannot always write efficient algorithms using nothing more than high-level abstractions like decimal; you need to talk to the machine in its own native language.

For instance, to determine if a positive whole number is odd or even, a human will simply look at the least significant digit. If it is 0, 2, 4, 6 or 8 then the value is clearly even otherwise it is odd. But that's a lot of processing for a computer because all values are encoded in binary, not decimal. To do it the human way you would need to divide the binary value by decimal 10 and then examine the remainder to determine the final digit. Then you have to compare that digit with 0, 2, 4, 6 and 8 to decide if it is even or not. An alternative approach that is more efficient is to divide the binary value by 2 and then check the remainder. If it is 0 then the number is even, otherwise it is odd. But there is an even better method. If the least-significant bit of the binary value is 0 then the number must be even, otherwise it must be odd. That's just simple binary logic but unless you are familiar with binary mathematics it may not be entirely obvious.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does mathematics have to do with programming languages?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can a mathematics student do well in programming languages?

Yes.


Can a mathematics student do well in computer science and several programming languages?

Of course; computer science is a very mathematics-oriented subject. Whether or not they can learn multiple programming languages depends entirely on whether or not that individual has the drive to do so.


What has the author Mark J Johnson written?

Mark J. Johnson has written: 'A concise introduction to programming in Python' -- subject(s): MATHEMATICS / General, Python (Computer program language), COMPUTERS / Programming Languages / General, Computer programming, MATHEMATICS / Advanced


What are the Definitions on programming?

Programming is a term that describes the usage of a programming language. Programming languages (C++ for example) are languages that create programs, these programming languages should not be confused with scripting languages. Scripting languages are languages that are meant to be interpenetrated by programs. (Written in a programming language)


Is it possible for a person who is strong at mathematics to be better at programming languages?

Yes. It's mainly question of hard work: learning and practising.


When was Essentials of Programming Languages created?

Essentials of Programming Languages was created in 2008-04.


How many pages does Essentials of Programming Languages have?

Essentials of Programming Languages has 416 pages.


What does a tuple stand for in mathematics?

Tuple is a term used in mathematics and computing science to show and ordered list of elements. Tuples are often used as product types in programming languages, and to describe other mathematical subjects in maths.


What has the author Martin Tompa written?

Martin Tompa has written: 'Time-space tradeoffs for straight-line and branching programs' -- subject(s): Electronic data processing, Programming (Mathematics), Programming languages (Electronic computers)


Why do you have different Programming languages?

why do we have diffrent programming laungage


What science is used in computer programming?

Computer programming relies heavily on the mathematical sciences, particularly discrete mathematics. The scientific method is often employed to test and debug computer programs. Knowledge of other sciences, such as physics or a particular social science, may be useful in computer programming depending on the specific software being programmed.


What is the best website to download C programming language?

Programming languages (or natural languages) cannot be downloaded.