function

/'fʌɳkʃn/
Học thuật
Thân thiện
function

The programmer writes a function to calculate the total price.

Definition
  1. Noun:

    • A specific purpose or role of something: The natural action or intended purpose of a person, object, or system.
    • A formal or official social event or ceremony: A large or important gathering, often for a specific purpose.
    • (Mathematics) A relation between sets: A rule that assigns each element from one set (the domain) to exactly one element in another set (the range).
    • A sequence of operations in computing: A self-contained block of code that performs a specific task within a larger program.
  2. Verb:

    • To work or operate in a proper or particular way: To perform the action or purpose for which a person or thing is designed.
    • To serve a particular purpose or role: To act as or fulfill the duties of something.
Examples of Usage
  • Noun:

    • The primary function of the heart is to pump blood.
    • We attended a charity function at the city hall.
    • In the equation y = 2x + 1, y is a function of x.
    • The software developer wrote a new function to sort the data.
  • Verb:

    • The elevator is not functioning properly.
    • This old sofa can function as a spare bed.
Advanced Usage
  • "To function as": To serve or be used as something.

    • In her absence, her assistant will function as the department head.
  • "Social function": A formal gathering of people for a social purpose.

    • The ambassador's reception is an important social function.
Variants and Related Words
  • Functional (adj): Designed to be practical and useful; in working order.
    • The design is simple and functional.
  • Functionary (n): A person who has to perform official functions or duties; an official.
    • A minor government functionary handled the paperwork.
Synonyms
  • Noun: Purpose, role, duty, operation, gathering, event.
  • Verb: Work, operate, run, serve, act.
Related Phrasal Verbs
  • Function under: To operate or work while experiencing specific conditions.
    • The team had to function under immense pressure.
Related Idioms
  • To be in working/functioning order: To be operational and able to perform its intended task.
    • After the repairs, the machine is finally in functioning order.
function

The programmer writes a function to calculate the total price.

Noun
  1. a set sequence of steps, part of larger computer program
  2. a vaguely specified social event
    • the party was quite an affair
    • an occasion arranged to honor the president
    • a seemingly endless round of social functions
  3. a formal or official social gathering or ceremony
    • it was a black-tie function
  4. a relation such that one thing is dependent on another
    • height is a function of age
    • price is a function of supply and demand
  5. the actions and activities assigned to or required or expected of a person or group
    • the function of a teacher
    • the government must do its part
    • play its role
  6. what something is used for
    • the function of an auger is to bore holes
    • ballet is beautiful but what use is it?
  7. (mathematics) a mathematical relation such that each element of a given set (the domain of the function) is associated with an element of another set (the range of the function)
Verb
  1. perform duties attached to a particular office or place or function
    • His wife officiated as his private secretary
  2. serve a purpose, role, or function
    • The tree stump serves as a table
    • The female students served as a control group
    • This table would serve very well
    • His freedom served him well
    • The table functions as a desk
  3. perform as expected when applied
    • The washing machine won't go unless it's plugged in
    • Does this old car still run well?
    • This old radio doesn't work anymore