Dictionary entry

div

nouncomputinginformal

Last updated

UK/dɪv/
US/dɪv/

Meanings

  1. nouncountablecomputing

    A programming operation that divides one whole number by another and gives only the whole-number result, throwing away the remainder.

    Grammar: Often used with the name of a language: Python's div, the div function.

    Patterns

    • the div operator
    • use div to do something
    • div something by something

    In many languages, 7 div 2 gives 3, because the remainder is dropped.

    Use div when you want a whole number and do not care about the fraction.

    The teacher explained that div is different from normal division, which would give 3.5 here.

  2. nouncountablecomputing

    A section or container in a web page, especially the HTML element named div.

    Grammar: Common in web design talk; you can say 'a div' or 'the div element'.

    Patterns

    • a div element
    • wrap something in a div
    • style a div

    She put the whole menu inside a single div.

    If the layout looks wrong, check the div that holds the sidebar.

    Each div can be given its own background color.

Word forms

pluraldivs

Common combinations

integer division
Integer division, often written as div, ignores any remainder.
div operator
The div operator is useful when you are counting whole items.
div element
The div element is a generic block on a web page.
div by zero
The program crashed because of a div by zero error.

Synonyms and how they differ

quotient
Quotient is the mathematical result of division and can be a decimal, while div usually means only the whole-number part.

Word family

division noun
The general mathematical process of dividing numbers.
divide verb
To separate into parts or groups, or to do a division calculation.
mod noun
The companion operation that gives the remainder instead of the whole-number result.

Commonly confused: div or mod? div or division?

div vs mod

Mod gives the remainder after division, while div gives the whole-number result. For 7 divided by 2, div gives 3 and mod gives 1.

div vs division

Division is the everyday word for the operation; div is a short, technical name for one kind of it in programming.

Practice

In a programming language, what does the expression 9 div 4 give?

Make it your own

Write a sentence using “div”, then check it and compare it with the examples above.

Your sentence stays on this page and is not sent anywhere.

Explore more words