📜  Rexx-数字

📅  最后修改于: 2020-11-02 03:59:44             🧑  作者: Mango


关于数字,Rexx具有以下数据类型。

  • 整数-字符串不包含小数点或指数标识符的数字。第一个字符可以是加号(+)或减号(-)。所表示的数字必须介于-2147483648和2147483647之间(含)。

  • 大整数-字符串不包含小数点或指数标识符的数字。第一个字符可以是加号(+)或减号(-)。表示的数字必须在-9223372036854775808和2147483648(含)之间,或在2147483648和9223372036854775807之间。

  • 十进制-以下格式之一-

    • 包含小数点但不包含指数标识符的数字字符串,其中p表示精度, s表示字符串表示的十进制数字的小数位数。第一个字符可以是加号(+)或减号(-)。

    • 字符串不包含小数点或指数标识符的数字。第一个字符可以是加号(+)或减号(-)。所表示的数字小于-9223372036854775808或大于9223372036854775807。

  • Float-代表科学计数形式的数字的字符串。该字符串由一系列数字后跟一个指数标识符(一个E或e以及一个可选的加号(+)或减号(-)和一系列数字)组成。该字符串可以以加号(+)或减号(-)开头。

现在让我们看一下可用于number的不同方法

Sr.No. Methods available for Numbers
1 ABS

This method returns the absolute value of an input number.

2 MAX

This method returns the maximum value from a list of numbers.

3 MIN

This method returns the minimum value from a list of numbers.

4 RANDOM

This method returns a random generated number.

5 SIGN

Returns 1 if number is greater than 0, or 0 if the number is 0, or -1 if the number is less than 0.

6 TRUNC

This method truncates a number.