That is, for 1.5 the routine will return 1, and for -1.5 it will return -1. The returned value is equal or smaller than the positive input value, and equal or greater than the negative input value. The Fix routine truncates the specified value. VBScript has several functions that accept a floating point value and return an integer value. Returns an integer indicating the sign of a number. If second parameter is omitted rounds off to integer. Returns a number rounded to a specified number of decimal places. The parameter value determines how Rnd generates a random number: if it is negative, then the same number is generated each time if it is zero, then the recently generated number is returned if it is not specified or is positive, then a new random number is generated. Returns a pseudorandom number between 0 and 1. If the number is negative it is rounded down. Returns the integer part of a specified number. Truncates the input value by excluding the fractional part. Returns e (the base of natural logarithms) raised to the specified power. For a more detailed description, see the Math Fuctions article in the MSDN library. MethodĬonverts a floating-point value to a string.Ĭonverts a floating-point value to a string using the one of predefined format settings.Ĭonverts the specified string to a floating-point value.Ĭonverts the specified string to an integer value.Ĭonverts the specified string to a long integer value.įurthermore, VBScript has several functions that perform mathematical operations over numbers. The objects are available for all supported scripting languages, so that you can use them to operate with date values regardless of the chosen language. The aqConvert and aqString objects contain several methods that can be helpful when working with numeric values. For example, 37e2 is a scientific notation for 3700. In this notation the exponent symbol "e" means "ten to the power of". Another possible notation for the floating point value is scientific or exponential notation. Generally, the fractional part is separated by the decimal point character. The floating-point number can be within the ☓.402823^38 range. For instance, &Hff is equivalent to decimal 255 and &H5EA is equivalent to decimal 1514.įloating-point numbers have a fractional part that can be as small as ☑.401298^-45. The letters from A to F are used to represent numbers from 10 to 15. The integer is treated as hexadecimal, if it is prefixed with "&H" and contains digits from 0 to 9 or letters from A to F (uppercased or lowercased). For instance, &O61 is equivalent to decimal 49. The integer is treated as octal, if it is prefixed with "&O" and contains digits from 0 to 7. The octal and hexadecimal numbers can be negative, but cannot be written in the exponential form or cannot have fractional parts. Generally, the integer number is considered to be in the decimal format, however octal and hexadecimal representation is also possible. The integer value can accept zero, positive and negative numbers within the ☒147483647 range.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |