Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
1,807,913,090 visitors served.
forum mailing list For webmasters
?
New: Language forums
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

variable
(redirected from varying)

   Also found in: Dictionary/thesaurus, Medical, Legal, Idioms, Wikipedia, Hutchinson 0.02 sec.

variable

In algebra, a symbol (usually a letter) standing in for an unknown numerical value in an equation. Commonly used variables include x and y (real-number unknowns), z (complex-number unknowns), t (time), r (radius), and s (arc length). Variables should be distinguished from coefficients, fixed values that multiply powers of variables in polynomials and algebraic equations. In the quadratic equation ax2 + bx + c = 0, x is the variable, and a, b, and c are coefficients whose values must be specified to solve the equation. In translating word problems into algebraic equations, quantities to be determined can be represented by variables.


variable

In programming, a structure that holds data and is uniquely named by the programmer. It holds the data assigned to it until a new value is assigned or the program is finished.

Control Values
Variables are widely used to hold control values that keep track of something. For example, the C statement FOR (X=0; X<5; X++) performs the instructions following the statement within open and closed curly braces ({ and }) five times, and X is keeping track of that number of iterations. X is a variable set to zero (x=0), incremented by 1 (x++) and compared to 5 (x<5). The reason it is less than 5 (<5) is because we started with 0.

The Equals Sign
Variables are usually assigned with an equal sign. Numbers are unquoted; for example: COUNTER = 1 places the digit 1 in the variable COUNTER. Character data (text) requires quotes; for example: PRODUCT = "abc1234". In some languages, the type of data must be declared before it is assigned; for example, in C/C++, the statement INT COUNTER creates a variable that holds only whole numbers (integers).

Local and Global
A local variable is one that is referenced only within the subprogram, function or procedure it was defined in. A global variable can be used by the entire program. See undefined variable and local variable.


variable
1. Maths having a range of possible values
2. (of a species, characteristic, etc.) liable to deviate from the established type
3. (of a wind) varying its direction and intensity
4. (of an electrical component or device) designed so that a characteristic property, such as resistance, can be varied
5. Maths
a. an expression that can be assigned any of a set of values
b. a symbol, esp x, y, or z, representing an unspecified member of a class of objects, numbers, etc.
6. Logic a symbol, esp x, y, z, representing any member of a class of entities
7. Computing a named unit of storage that can be changed to any of a set of specified values during execution of a program
8. a variable wind
9. a region where variable winds occur

variable [′ver·ē·ə·bəl]
(computer science)
A data item, or specific area in main memory, that can assume any of a set of values.
(mathematics)
A symbol which is used to represent some undetermined element from a given set, usually the domain of a function.

(programming)variable - (Sometimes "var" /veir/ or /var/) A named memory location in which a program can store intermediate results and from which it can read it them. Each programming language has different rules about how variables can be named, typed, and used. Typically, a value is "assigned" to a variable in an assignment statement. The value is obtained by evaluating an expression and then stored in the variable. For example, the assignment

x = y + 1

means "add one to y and store the result in x". This may look like a mathematical equation but the mathematical equality is only true in the program until the value of x or y changes. Furthermore, statements like

x = x + 1

are common. This means "add one to x", which only makes sense as a state changing operation, not as a mathematical equality.

The simplest form of variable corresponds to a single-word of memory or a CPU register and an assignment to a load or store machine code operation.

A variable is usually defined to have a type, which never changes, and which defines the set of values the variable can hold. A type may specify a single ("atomic") value or a collection ("aggregate") of values of the same or different types. A common aggregate type is the array - a set of values, one of which can be selected by supplying a numerical index.

Languages may be untyped, weakly typed, strongly typed, or some combination. Object-oriented programming languages extend this to object types or classes.

A variable's scope is the region of the program source within which it represents a certain thing. Scoping rules are also highly language dependent but most serious languages support both local variables and global variables. Subroutine and function formal arguments are special variables which are set automatically by the language runtime on entry to the subroutine.

In a functional programming language, a variable's value never changes and change of state is handled as recursion over lists of values.


How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Email
Feedback
? Mentioned in
 
Encyclopedia browser? ? Full browser
 
 
Encyclopedia
?

Disclaimer | Privacy policy | Feedback | Copyright © 2009 Farlex, Inc.
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. Terms of Use.