VMS Help
RTL Routines, OTS$, OTS$CVT T x
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
The Convert Numeric Text to D-, F-, G-, or H-Floating routines
convert an ASCII text string representation of a numeric value to
a D-floating, F-floating, G-floating, or H-floating value.
Format
OTS$CVT_T_D fixed-or-dynamic-input-string
,floating-point-value [,digits-in-fraction]
[,scale-factor] [,flags-value] [,extension-bits]
OTS$CVT_T_F fixed-or-dynamic-input-string
,floating-point-value [,digits-in-fraction]
[,scale-factor] [,flags-value] [,extension-bits]
OTS$CVT_T_G fixed-or-dynamic-input-string
,floating-point-value [,digits-in-fraction]
[,scale-factor] [,flags-value] [,extension-bits]
OTS$CVT_T_H fixed-or-dynamic-input-string
,floating-point-value [,digits-in-fraction]
[,scale-factor] [,flags-value] [,extension-bits]
OpenVMS usage:cond_value
type: longword (unsigned)
access: write only
mechanism: by value
fixed-or-dynamic-input-string
OpenVMS usage:char_string
type: character string
access: read only
mechanism: by descriptor, fixed-length or dynamic string
Input string containing an ASCII text string representation of
a numeric value that OTS$CVT_T_x converts to a D-floating, F-
floating, G-floating, or H-floating value. The fixed-or-dynamic-
input-string argument is the address of a descriptor pointing to
the input string.
The syntax of a valid input string is as follows:
[blanks][+ or -][digits][.][digits][+ or -][digits]
or
[blanks][+ or -][digits][.][digits][ X ][digits]
where X = {E e D d Q q}[blanks][+ or -]
E, e, D, d, Q, and q are the possible exponent letters. They are
semantically equivalent. Other elements in the preceding syntax
are defined as follows:
Term Description
blanks One or more blanks
digits One or more decimal digits
floating-point-value
OpenVMS usage:floating_point
type: D_floating, F_floating, G_floating, H_floating
access: write only
mechanism: by reference
Floating-point value that OTS$CVT_T_x creates when it converts
the input string. The floating-point-value argument is the
address of the floating-point value. The data type of floating-
point-value depends on the called routine as shown in the
following table:
Routine floating-point-value Data Type
OTS$CVT_T_D D-floating
OTS$CVT_T_F F-floating
OTS$CVT_T_G G-floating
OTS$CVT_T_H H-floating
digits-in-fraction
OpenVMS usage:longword_unsigned
type: longword (unsigned)
access: read only
mechanism: by value
Number of digits in the fraction if no decimal point is included
in the input string. The digits-in-fraction argument contains the
number of digits. If the number of digits is omitted, the default
is zero.
scale-factor
OpenVMS usage:longword_signed
type: longword (signed)
access: read only
mechanism: by value
Scale factor. The scale-factor argument contains the value of
the scale factor. If bit 6 of the flags-value argument is clear,
the resultant value is divided by 10**scale-factor unless the
exponent is present. If bit 6 of flags-value is set, the scale
factor is always applied. If the scale factor is omitted, the
default is zero.
flags-value
OpenVMS usage:mask_longword
type: longword (unsigned)
access: read only
mechanism: by value
User-supplied flags. The flags-value argument contains the user-
supplied flags described in the following table:
Bit Action if Set Action if Clear
0 Ignore blanks. Interpret blanks as zeros.
1 Allow only E or e Allow E, e, D, d, Q and q exponents.
exponents. (This (This is consistent with BASIC
is consistent with semantics.)
Fortran semantics.)
2 Interpret an Do not interpret an underflow as an
underflow as an error.
error.
3 Truncate the value. Round the value.
4 Ignore tabs. Interpret tabs as invalid characters.
5 An exponent must The exponent letter can be omitted.
begin with a valid
exponent letter.
6 Always apply the Apply the scale factor only if there
scale factor. is no exponent present in the string.
If you omit the flags-value argument, OTS$CVT_T_x defaults all
flags to clear.
extension-bits (D-, F-floating)
OpenVMS usage:byte_unsigned
type: byte (unsigned)
access: write only
mechanism: by reference
extension-bits (G-, H-floating)
OpenVMS usage:word_unsigned
type: word (unsigned)
access: write only
mechanism: by reference
Extra precision bits. The extension-bits argument is the address
of a word containing the extra precision bits. If extension-
bits is present, floating-point-value is not rounded, and the
first n bits after truncation are returned left-justified in this
argument, as follows:
Number
of Bits
Routine Returned Data Type
OTS$CVT_T_D 8 Byte (unsigned)
OTS$CVT_T_F 8 Byte (unsigned)
OTS$CVT_T_G 11 Word (unsigned)
OTS$CVT_T_H 15 Word (unsigned)
A value represented by extension bits is suitable for use as the
extension operand in an EMOD instruction.
The extra precision bits returned for H-floating may not be
precise because OTS$CVT_T_H carries its calculations to only
128 bits. However the error should be small.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.