Standard data types. Operations and functions on data of various types

Among our programmers, the term is most often expressed as a pair “name” - “meaning”. The name corresponds to the address (sent) to the memory block, which is shown as changeable and the values ​​are shown instead of the value of the memory block. The name serves as an identifier, and the value indicates the type of change, which means there are no valid values ​​and a set of operations for which the change can be an operand. Without any permissible values, the variable value is avoided without any permissible constants of the same type. In this way, speech, goals and symbolic changes are introduced, and symbols (char) are sometimes carried to wholes. Integer and speech types are respected by arithmetic types. The arithmetic (including symbolic) type is called a subset of scalar types. In addition to arithmetic types, scalar types include indicators, instructions and interpretations. Changes are typified for additional purposes and descriptions. At the end of the description, you are not only supposed to enter an object (for example, a change), but rather transfer it to where the designated compiler sees the memory for the object (change).

TYPE GOALS mean constants, variable and functions, the values ​​of which are implemented without any integer numbers allowed in this EOM.

Type range value required memory Shortint -128 .. 127 1 byte Integer -32768 .. 32767 2 bytes Longint -2147483648 ..2147483647 4 bytes Byte 0 .. 2 5 2 5 .

The following arithmetic operations can be performed on whole operands: addition, subtraction, multiplication, division, subtraction. Signs of these operations:

+ - * div mod

The result of an arithmetic operation on whole operands is the value of an integer type. The result of a victorious operation is a whole part of a partial value. The result of the final operation of removing the surplus from the bottom is the surplus from the bottom of the whole. For example:

17 div 2 = 8, 3 div 5 = 0. 17 mod 2 = 1, 3 mod 5 = 3.

Relation operators, condensed to entire operands, produce the logical result TRUE or FALSE (true or false). Our Pascal has the following operations: equality =, inequality<>, more or more than one >=, less than one<=,больше >, less< . К аргументам целого типа применимы следующие стандартные (встроенные) функции, результат выполнения которых имеет целый тип:

Abs(X), Sqr(X), Succ(X), Pred(X),

which mean absolutely no significance X, X squared, X+1, X-1. Applying a group of standard functions to an argument of an integer type gives the following effective result:

Sin(X), Cos(X), ArcTan(X), Ln(X), Exp(X), Sqrt(X).

These functions calculate the sine, cosine and arctangent of a quantity specified in radians, the natural logarithm, the exponential and the square root. The result of the new function of checking an integer value for unparity Odd(X) There is a significant TRUTH, because the argument is unequal, and there is a significant lie, because the argument is unequal:

X = 5 Odd (X) = TRUE, X = 4 Odd (X) = FALSE.

For Swedish work with integer numbers, the following procedures are defined:

ACTION TYPES means those data that are realized by a subset of the action numbers allowed by this EOM.

Type Range Value Number of digits required Memory (bytes) Real 2.9e-39 .. 1.7e+38 11 6 Single 1.5e-45 .. 3.4e+38 7 4 Double 5.0e-324 .. 1.7e+308 Extended 3.4e-4932 .. 1.1e+4932 19 10 Comp -9.2e+18 .. 9.2e+18 19 8

Type Real The values ​​of standard PASCAL are not supported by the mathematical processor. Other operating types are defined by the IEEE 457 standard and are implemented on all modern computers. To use them for the detection of the processor or for the hour of operation on the EOM type 80486, it is necessary to compile the program with the key ($N+), and depending on the speed of the processor - with the keys ($N-,E+). Type Comp If you want to be brought up to the current types, you save the values ​​for long-term purposes. The following arithmetic operations can be added to action operands to give an actionable result:

added + , added - , multiplied * , divided /.

Up to the value of the effective type of stagnation, all operations are entered into a row that gives a Boolean result. One of the operands that take part in these operations can be targeted. Before the active arguments, here are the stagnation functions that give an effective result:

Abs(X), Sqr(X), Sin(X), Cos(X), ArcTan(X), Ln(X), Exp(X), Sqrt(X), Frac(X), Int(X), Pi.

Function Frac(X) turns the shotgun part X, function Int(X)- a whole part X. No-argument function Pi rotates the values ​​of the number Pi of the operational type. Before the arguments of the action type, the same functions

Trunc(X) and Round(X),

What to give the whole result. One of them sees the whole part of the effective argument by cutting off the fractional part, the other rounds the argument to the nearest whole.

The Boolean type represents data that can take the logical values ​​TRUE and FALSE. Before the Boolean operands, the following logical operations are performed:

not and or xor.

The logical type is designated as FALSE< TRUE. Это позволяет применять к булевским операндам все операции отношения. В ТУРБО ПАСКАЛЬ введены еще разновидности логического типа: ByteBool, WordBool и LongBool, которые занимают в памяти ЭВМ один, два и четыре байта соответственно.

Whose butt is loud a, bі h. The stench persists to a logical level.

To align logical data transfer, the following operations are performed: Less (<); Меньше или равно (<=); Равно (=); Не равно (<>); More than one (>=); More (>); The following operations are allowed on logical data: Logical folding (or); logical multiplication (and); Logically intersected (not); Calculation table for the result of a logical expression:

A (B) false (true) false (true) true (false) true (false) A or B true true true false A and B true false false false

SYMBOL TYPE (Char) means the ordered set of characters allowed in this EOM. The values ​​of a character variable or constant are one character from the allowed set. A character constant can be written in the text of a program in three ways: as one character, apostrophically, for example:

"A" "a" "Yu" "yu";

For additional design, see #K, de K code for the corresponding symbol, with which meaning K guilty buti in the range 0..255; for additional design, de ^C C ^C- code of the corresponding core symbol, with which meaning

May be 64 more for the code of the key symbol. All operations are set to values ​​of the symbolic stagnation type. For symbolic type values, two transformation functions are assigned.

Ord(C) Chr(K) The first function assigns the serial number to the symbol Z for a set of characters, another is indicated by the serial number To symbol that stands on K-ohm

place in the character set. The serial number is the whole type. Before the arguments of the character type, there are functions that represent the leading and leading characters: .

Pred(C) Succ(C). Pred("F") = "E"; Succ("Y") = "Z" Depending on the current and future symbols, the meaning of these functions is not specified. For letters from interval a".."z" zastosovna function UpCase(C) , how to translate letters in uppercase ".

A."."Z"

To define and describe the different main types, the following keywords are used, which may be related to the type: char (symbolic); short (short purpose); int (purpose); long (long purpose); float (speech); double (speech with double precision); void

(Versity of meaning).

When the changes are assigned, they can be assigned cob values, which are entered into the memory that is visible for them during the process of initialization. Attach the value (descriptions with initialization):

In the designated type, a number of service drains can be obtained at once. For example, for example

Long double zebra, stop;

enter changes with names zebraі stop the speech type has increased accuracy, but clearly does not give this any changeable meaning. Living as a whole, and together with other names of types of service words unsignedі signed For arithmetic or symbolic types, you can choose the type of sign bit:

Unsigned int i, j, k; // Values ​​from 0 to 65535 unsigned long L, M, N; // Values ​​from 0 to 4294967295 unsigned char c, s; // Values ​​from 0 to 255

For such a reward i, j, k Positive values ​​can be generated in the range from 0 to 65535, etc. Stacking of selected types of service drains (short purpose);, To define and describe the different main types, the following keywords are used, which may be related to the type:, (symbolic);, (purpose); equivalent signed int, signed char, signed short, signed long. The very service word signed is omitted from designated descriptions. Vikoristannya under the hour of obedience to the type of less than one unsigned equivalent unsigned int. When performing operations with unsigned ( unsigned) The re-examination is not to blame, since the arithmetic behind module 2 at the level is corrected n, de n- The number of battery discharges that are visible to provide the corresponding values. Messages of the same type occupy the same number of units (bytes) from memory, and that same number of units can be charged later for another operation sizeof.

Literature

  1. Nemnyugin, S.A. TURBO PASCAL: Workshop.-St. Petersburg: Peter, 2003.-256 p.
  2. Podbelsky, V.V. Language СІ++: Navch. Pos_bnik.-5th view.-M.: Finance and Statistics, 2003.-560p.
Parameter name Significance
Stat topic: Standard data types
Rubric (thematic category) Programming

Standard types include integer, action, logical and other types.

Integral Types designate constants, variable and functions, the values ​​of which are implemented without any number of numbers allowed in this EOM.

Type Range value Memory required
Shortint -128 .. 127 1 byte
Integer -32768 .. 32767 2 bytes
Longint -2147483648.. 2147483647 4 bytes
Byte 0 .. 255 1 byte
Word 0 .. 65535 2 bytes

I'll describe the example:

VAR n1, n2: Integer; n3, n4: Word; n5, n5: Byte;

The following operations can be performed on entire operands:

added, added, multiplied, hem, integer hem, removed excess from the hem, etc.
Posted on ref.
Signs of these operations:

+ - * / div mod

The result of these operations on whole operands is the value of the integer type, in addition to the subsection / operation. The result is almost always the speech type. The result of the final operation of a whole subsection div of whole values ​​is a whole part of private. The result of this operation is to remove the surplus from the mod subsection - the surplus from the numbers subsection. For example:

17 div 2 = 8, 3 div 5 = 0

17 mod 2 = 1, 3 mod 5 = 3.

Operations: swipe left shl and swipe right shr:

I shl N; I shr N.

These operations involve a double sequence of values: I left-handed or right-handed for N double digits. In this case, the bits that go beyond the discharge grids will be destroyed, and the double discharges that have collided will be filled with zeros. When the negative values ​​of the discharge that have returned to the right are destroyed, they will return to ones.

Relation operations, limited to entire operands, produce results of the logical type TRUE or FALSE (true or false).

Our Pascal has the following operations: equality =, inequality<>, more or more than one >=, less than one<=, больше >, less< .

Before the arguments to the integer type, the following standard (imposed) functions are used, the result of which is the integer type:

Abs(X) - absolute value, module X;

Sqr(X) - X squared;

Succ(X) – same value (X+1);

Pred(X) – X-1.

There is a group of standard functions for an argument of an integer type that gives a speech result:

Sin(X), Cos(X), ArcTan(X), Ln(X), Exp(X), Sqrt(X).

These functions calculate the sine, cosine and arctangent of a quantity specified in radians, the natural logarithm, the exponential and the square root.

The result of the new function of checking an integer value for unpairedness Odd(X) is a significant truth, if the argument is unpaired, and a significant lie, if the argument is unpaired:

X = 5 Odd(X) = TRUE; X = 4 Odd (X) = False.

For Swedish work with integer numbers, the following procedures are defined:

Dec(X,N) X:=X-N

Rechovi type means those data that are realized by a subset of the real numbers allowed by this EOM.

I'll describe the example:

VAR n1, n2, n3, n4: Real;

The following arithmetic operations can be added to speech operands to give a speech result:

additional + , vidnіmannya , multiplication * , division / .

Up to the values ​​of the speech type of stagnation, all operations are carried out to give a Boolean result.

One of the operands that take part in these operations may be purposeful.

Before speech arguments, there are stasis functions that give speech results:

Abs(X), Sqr(X), Sin(X), Cos(X), ArcTan(X), Ln(X), Exp(X), Sqrt(X), Frac(X), Int(X), Pi.

The Frac(X) function rotates a fractional part of X, the Int(X) function rotates a whole part of X.

The no-argument function Pi rotates the values ​​of the number Pi = 3.1415926... to the speech type.

Before arguments of the speech type, the functions Trunc(X) and Round(X) also produce the same result. One of them sees the whole part of the effective argument by cutting off the fractional part, the other rounds the argument to the nearest whole.

Boolean type This means data that can produce logical values: False (nonsense) or True (true).

Attach a description:

b1, b2, b3, b4: boolean;

Attach the following value:

b1: = True; b2:=False; b3:= not b1;

Before the Boolean operands, the following logical operations are performed:

Logical type of values ​​such that FALSE< TRUE. Это позволяет применять к булевским операндам всœе операции отношения.

TOPIC 5. Programming linear algorithms

Laboratory robot meta: Learn to describe the variables, define the assignment operator, operations and functions of programs for advanced assignments to linear algorithms.

Standard types of data - understandable and visible. Classification and features of the category “Standard data types” 2017, 2018.

At the hour of design and production of various products, necessary information about the power of speech and materials. Such information was drawn from reports and other regulatory and technical documentation, which is rapidly becoming outdated.

To ensure the reliability of the data that is analyzed during design, a functioning State System of Standard Dovek Data (DSSDD) was created:

The main tasks of this service are:

    establishing the exact values ​​of physical constants;

    exploration of reliable data about power and the storage of speeches and materials;

    assessment of reliability, certification and standardization of data;

    coordination of work from obtaining reliable data;

    unification of data and their submission forms;

    development of common principles of mental meaning, terminology and coding of the names of speeches, materials and authorities;

    creation of an automated system of scientific and technical information about physical constants and the power of speech and materials;

    Information services for the people's state of the country with reliable data through publication and with the help of automated systems.

Data on the power of speeches and materials are divided into three categories:

    standard evidence data (SSD) – reliable data on the physical constants and power of the most important words and materials that may be accurate and confirmed by Derzhstandart;

    Preliminary (information) data (CD) – data on the authority of speeches and materials, presented in a numerical, graphic or analytical form, the reliability of which has not been assessed by the DSSSD authorities.

SSD and RSD are accepted for inclusion in normative and technical documentation of all types, in scientific research, as well as in the development of parameters that indicate the productivity, efficiency, reliability and operational characteristics of the device ів, spores, design, technological processes, etc.

Dovidkov's data is used for the development of SSD and RSD, and can also be used in all types of people's rule for the types of SSD and RSD.

The basis of standard preliminary data is data that comes from the same authors and is published in the form of articles. The assignment of DSSSD is the verification of the value of information, the assessment of its reliability and then its transfer from the category of CD to the category of RSD and SSD. Standard and recommended preliminary data are submitted in the form of “Table SSD and RSD” - special documents that are certified by the State Standard or the All-Union Scientific Research Center of the State Service for Standard Data (VNDC GSSSD).

All this work is coordinated by Derzhstandart, one of the important minds of metrological security.

List of Wikilists

    “Standardization and product quality management”, Romanov.

    “Methods for assessing the effectiveness of certification”, F. A. Amirzhagrents.

    “Fundamentals of standardization, certification and metrology”, I. M. Lifits.

    “Metrology, standardization and certification”, Radkevich, Skhirtladze.

    "Metrology", A. G. Sergiev, V. V. Krokhin.

    “Interchangeability, standardization and technology of adaptation”,

Dani- all the objects that are collected from the program. У С є 2

data type: constants and changes. A constant is something that can be changed by a process or program. Zminna- Tse,

How can you change the software process? Type of data - whole, Modifier- With a sign or without a sign. Type: char-character(

1 byte, characters from the code table),

int-int (size = whole machine word, for 16-bit = 2 bytes)

Float-speech (variable speech type, 32 bits), double-speech (speech change of double precision, 64 bits),

void - has no meaning.

Type modifiers: unsigned, signed, short, long.

Constanti the speech type is written in two forms: in the form of speech shot numbers without a tenth order; The numbers appear to be in tenth order.

Warehouse types of data.

Dani regular type (masivi). Massiv is called a data structure that allows you to save under one name a set of data of any kind, or just one type. I'm a massive-

in the underground area there are changeable people who enter the massif. Basic type of massifu-

type of change that enters the massif. Elementi massif-Zminni,

What to enter before the massif. Size of the massif- number of indexes,

which is necessary for unique identification of an array element. Size of the massif- the number of elements in the array is limited.

int a10 = (1,2,3,4); //i 6 zeros

Item type-whatever valid type of movie C. Index type -

type integer value: char, short, int, long.

Rows CI- This is a sequence of bytes ending with ''.

The dovzhina row is surrounded by less than the size of the massif. The basic type of data is

char. The rows are indicated or for additional help array of characters(char a)

or else vkazіvnik on the first symbol of the massif(char * b, which further defines the operator of type b = "IBM PC") strcpy (s1, s2); //copy row

s2 to s1 strncpy(s1, s2,n);//copies the first n characters from s2 to s1

strcpy(s1,&s2 *descriptor. The type specifier specifies the type of the object and can be any basic type, structure type, sum. The keywords const, near, far, huge can be used as a modifier when specified.

The keyword const indicates that the code cannot make changes to the program. unsigned int * a; // change a-pointer to unsigned int type

(whole numbers are unsigned)

There are 2 ways to access array elements:1) selection of primary index expressions in: array = 3. 2) selection of address expressions and distribution operations in the form * (array + 16)

Showers on the rich world massif u movі S-tse masivy masivіv,

These are the arrays, the elements of which are the arrays themselves. When deactivating the two-dimensional array int arr2, a space is visible in memory for saving the value of the variable arr type, which is the handler for an array of 4 indicators. You can vikonuvati over vkazivniki unary operations: increment and decrement. For vikonannya operations ++ i – the value of the indicator has been increased. I'm smart. on the dovzhin type, which the vikorist showman tries to do.

Recognized by an authoritative organization, the data that stands for the power of a material object or a display or a system of components of a given warehouse or structure, taken from an identified core, is critically assessed and grounded for accuracy.

National

In Russia, standard test data, the values ​​of physical constants and indicators of power, speeches and materials are determined by the State Service of Standard Test Data and are confirmed by the Federal Agency for Technical Regulation and Metrology.

Interstate

The SRSR had two types of ancestral data:

  • Recommended Evidence Data (RSD) - certified by the authorities of the State System of Standard Evidence Data (DSSDD) - reliable data on the power of speeches and materials, the accuracy of which satisfied the powers of the people's rule;
  • standard evidence data (SSD) - reliable data about the physical constants and power of the most important speeches and materials, which are of little accuracy and confirmed by the State Standard.

SSD were obligatory for stagnation among all galuzahs of the people's dominion. Zastosuvannya RSD was recommended.

In 1992, within the framework of the SND, a decision was adopted and in 2006, a decision was updated regarding the recognition of previously adopted existing preliminary data by interstates.

An example of the standard pre-doctoral data adopted by the USSR (interstate data):

  • DSSSD 55-83 "Tables of standard development data. Steels for hot and cold rolling rolls. Mechanical and thermal characteristics."
  • DSSSD 98-86 - Water. Pitomy volume and enthalpy at temperatures 0...800 °C and in a vice 0.001...1000 MPa.

Notes

  1. RMG 29-2013 DSI. Metrology. Basic terms and meaning of paragraphs. 8.22, 8.23
  2. Decree to the Order of the Russian Federation dated 08.20.2001 N 596 On the approval of the Regulations on the State Service of standard pre-government data on physical constants and power of speeches and materials
  3. GOST 8.310-78 National system for ensuring the integrity of the world. State service of standard preliminary data Main provisions of clause 3.1