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:

    One murder makes a villain, millions a hero. Numbers sanctify, my good fellow.
    Charlie Chaplin (1889–1977)

    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)

    Wealth is so much the greatest good that Fortune has to bestow that in the Latin and English languages it has usurped her name.
    William Lamb Melbourne, 2nd Viscount (1779–1848)