#### WWT took an enterprise Tower of Babel and del... |

*Dana*

*on 14 December 16*

MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.

I'm not curious

I'm not curious

Online Professional & IT Career Development Platform

SKIP>>

We built MyTechLogy for you

Help us to help you.

Share your expectations and experience to improve it.

Please enter your feedback.

Click here to continue..

Thank you for your Feedback

Your feedback would help us in sending you the most relevant job opportunities

Published on 16 October 14

310

0

**1.Data types in esProc**

In esProc, the following basic data types are available:

**Integer**

Any integer between -231 and 231-1, i.e. the value range is -2147483648~2147483647.The type conversion function int()can be used to convert other types of data into integer.

**Long integer**

-263~263-1, which is a value range bigger than that for integer type. The type conversion function long()can be used to convert other types of data into long integer.

Long integer can be specially represented by appending a capital letter L to the integer. Compared with an integer, a long integer has a bigger value range; strings starting withSince the value range of common integers is -2^{31}~2^{31}-1, that is, -2147483648~2147483647, the result in A2 is beyond the boundary. While by using a long integer in A1, the value range is increased to -2^{63}~2^{63}-1 and correct result can be obtained. In A3, the number 12345678900 is beyond the value range of common integers and will be parsed automatically into a long integer. It is a hexadecimal constant that cell A4 contains. Values of A1, A2, A3 and A4 are as follows:

As can be seen from the computed results of A1 and A3, if one of the operands involved is a long integer during the operation of a certain step, the result will be a long integer.

**Floating-point number**

Values of A1, A2, A3 and A4 are as follows:

The floating-point number in A2 is represented by scientific notation; A3 contains a floating-point number represented by a percentage, which, with this writing form, can only be used as a constant instead of being used in an expression.

**Big decimal**

The 5.2 in A1 is a floating-point number; the code in A3 converts the string â5.2â into a big decimal. The computed results in A2 and A4 are as follows:

It can be seen that the operation using a floating-point number that works according to the binary rule could result in accuracy errors, while the operation using a big decimal is much more accurate.

**Real number**

The real number covers four data types: integer, long integer, floating-point number and big decimal. number()is the type conversion function available to convert other types of data to real number.

**Boolean **

Values of A1, A2, A3 and A4 are as follows:

**String**

Double quoted in an expression, and the right slash \ is used as the escape character. If the string is defined in a constant cell directly, the double quotation marks are omitted.string() function can be used to convert other types of data to strings. When concatenating two strings x and yin an expression, you can add a space between them, that is, **xy**.

Values of A1, A2 and A3 are as follows:

**Datetime**

Values of A1, A2 and A3 are as follows:

Click **Tool->****Options** menu item, and set the format of time/date data and the character code, etc. on the** ****Environmenttab. **

Precision may be sacrificed when a type of data is converted into another one.

**2. Judge the data type**

The type of data can be judged with the following functions:

**ifnumber(x) **

Judge if x is a real number

**ifstring(x)**

Judge if x is a string

**ifdate(x)**

Judge whether x is a date or a datetime

**iftime(x)**

In A1, the floating-point number 3.5 is a real number. **now()** function in A2 computes the current date and time and the resut is not a string. The results in A1 and A2 are as follows:

In esProc, the following basic data types are available:

Any integer between -231 and 231-1, i.e. the value range is -2147483648~2147483647.The type conversion function int()can be used to convert other types of data into integer.

-263~263-1, which is a value range bigger than that for integer type. The type conversion function long()can be used to convert other types of data into long integer.

Long integer can be specially represented by appending a capital letter L to the integer. Compared with an integer, a long integer has a bigger value range; strings starting with

Since the value range of common integers is -231~231-1, that is, -2147483648~2147483647, the result in A2 is beyond the boundary. While by using a long integer in A1, the value range is increased to -263~263-1 and correct result can be obtained. In A3, the number 12345678900 is beyond the value range of common integers and will be parsed automatically into a long integer. It is a hexadecimal constant that cell A4 contains. Values of A1, A2, A3 and A4 are as follows:

As can be seen from the computed results of A1 and A3, if one of the operands involved is a long integer during the operation of a certain step, the result will be a long integer.

64-bit floating-point number is the commonest data type in esProc. Almost all decimals-related computations are performed with this data type. The type conversion function float() can be used to convert other types of data to floating-point number. Because the floating-point number is used to store data according to the binary rule, there could be errors in the computation.

Values of A1, A2, A3 and A4 are as follows:

The floating-point number in A2 is represented by scientific notation; A3 contains a floating-point number represented by a percentage, which, with this writing form, can only be used as a constant instead of being used in an expression.

Big decimal can be used to store any real number error-freely, but more memory could be consumed when big decimal is used for computation and the computational efficiency is relatively low. The type conversion function

The 5.2 in A1 is a floating-point number; the code in A3 converts the string â5.2â into a big decimal. The computed results in A2 and A4 are as follows:

It can be seen that the operation using a floating-point number that works according to the binary rule could result in accuracy errors, while the operation using a big decimal is much more accurate.

The real number covers four data types: integer, long integer, floating-point number and big decimal. number()is the type conversion function available to convert other types of data to real number.

It includes true and false :

Values of A1, A2, A3 and A4 are as follows:

Double quoted in an expression, and the right slash \ is used as the escape character. If the string is defined in a constant cell directly, the double quotation marks are omitted.string() function can be used to convert other types of data to strings. When concatenating two strings x and yin an expression, you can add a space between them, that is,

The escape rule of strings is the same as that of JAVA. For details, please refer to the manual.

Values of A1, A2 and A3 are as follows:

Written in the format of yyyy-mm-dd and hh:mm:ss.Type conversion functions such as

Values of A1, A2 and A3 are as follows:

Click

Precision may be sacrificed when a type of data is converted into another one.

The type of data can be judged with the following functions:

Judge if x is a real number

Judge if x is a string

Judge whether x is a date or a datetime

Judge if x is a time

In A1, the floating-point number 3.5 is a real number.

Related Posts:

Post a Comment