Computer Number Format - Numbers in Programming Languages

Numbers in Programming Languages

Low-level programmers have to worry about unsigned and signed, fixed and floating-point numbers. They have to write extremely different code, with different opcodes and operands, to add two floating point numbers compared to the code to add two integers.

However, high-level programming languages such as LISP and Python offer an abstract number that may be an expanded type such as rational, bignum, or complex. Programmers in LISP or Python (among others) have some assurance that their program code will Do The Right Thing with mathematical operations. Due to operator overloading, mathematical operations on any number—whether signed, unsigned, rational, floating-point, fixed-point, integral, or complex—are written exactly the same way. Others languages, such as REXX and Java, provide decimal floating-points, which avoids many "unexpected" results.

Read more about this topic:  Computer Number Format

Famous quotes containing the words numbers, programming and/or languages:

    Our religion vulgarly stands on numbers of believers. Whenever the appeal is made—no matter how indirectly—to numbers, proclamation is then and there made, that religion is not. He that finds God a sweet, enveloping presence, who shall dare to come in?
    Ralph Waldo Emerson (1803–1882)

    If there is a price to pay for the privilege of spending the early years of child rearing in the driver’s seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.
    Melinda M. Marshall (20th century)

    It is time for dead languages to be quiet.
    Natalie Clifford Barney (1876–1972)