Table 20-24 Procedure to encode a number (continued)

2.Round to an integer. Round the results of step 1 to the nearest integer.

x = round (x)

x = round (10,525.42) =

 

10,525

3.Set the sign bit. If x is positive, multiply it by two. If x is negative, multiply the absolute value of x by two and add one. This sets the sign bit.

if (x ≥ 0)

x = 2 × x

x = 2 × 10,525 = 21,050

else

x = 2 × abs(x) + 1

4.Convert the number to base 64 or 32 and encode the data. Convert x to a base 64 number if your system sends 8 bits without parity. Convert x to a base 32 number if your system sends 7 bits with parity (seven-bit flag is sent).

Encode each base 64 or 32 digit into the ASCII character range, as described below. Output each character as it is encoded, starting with the least significant digit. The most significant digit is used to terminate the number and is encoded into a different ASCII character range than the low order digits.

Each number in a coordinate pair is represented as zero or more non-terminator characters, followed by a terminator character. A character is a non-terminator or terminator depending on the range it is in; refer to the following table. For example, in base 64 there are 64 non-terminator and 64 terminator characters. Either kind represents a "digit."

20-38The Vector Group

EN

Page 498
Image 498
HP 5961-0509 manual = round, 10,525, If x ≥ = 2 ×, Else = 2 × absx +, 20-38The Vector Group