Conversion of signed 32-bit to ascii string, Conversion of ascii string to signed 32-bit, Signed 32-bit performance – Echelon Neuron C User Manual

Page 77

Advertising
background image

Neuron C Reference Guide

57

Short

Name Function

from
ulong

void s32_from_ulong(unsigned long arg1, s32_type *arg2);

Converts a Neuron C unsigned long integer (range 0 to +65,535) to a

signed 32-bit integer.

Conversion of Signed 32-bit to ASCII String

Table 18 lists the conversion function for a signed 32-bit number to an ASCII
string.

Table 18. Conversions of Signed 32-Bit Numbers to ASCII Strings

Short

Name Function

to
ascii

void s32_to_ascii(const s32_type *arg1, char *arg2);

Converts a signed 32-bit integer *arg1 to an ASCII string followed by a

terminating null character. The *arg2 output buffer should be at least
12 bytes long. The general output format is [-]xxxxxxxxxx, with one to

ten digits.

Conversion of ASCII String to Signed 32-bit

Table 19 lists the conversion function for an ASCII string to a signed 32-bit

number.

Table 19. Conversions of ASCII Strings to Signed 32-Bit Numbers

Short

Name Function

from
ascii

void s32_from_ascii(const char *arg1, s32_type *arg2);

Converts an ASCII string arg1 to a signed 32-bit integer in *arg2. The
conversion stops at the first invalid character in the input buffer – there

is no error notification. The acceptable format is [-]xxxxxxxxxx. The
number of digits should not exceed ten. Embedded spaces within the

string are not allowed.

Signed 32-Bit Performance

Table 20 on page 58 lists times in milliseconds for the various 32-bit functions.

They were measured using a Series 3100 Neuron Chip with a 10 MHz input
clock. These values scale with a faster or slower clock. The measurements are

maximums and averages over random data uniformly distributed in the range [-

2,147,483,648 to +2,147,483,647].

Advertising