Re: converting hex strings to decimal digits strings

New Message Reply About this list Date view Thread view Subject view Author view

Ge' Weijers (ge@Progressive-Systems.Com)
Wed, 25 Mar 1998 15:26:49 -0500 (EST)


For efficiency's sake you could calculate mod 10^9 (assuming your
single-precision integers are that large), and then convert the
single-precision integers between 0 and 999999999 into strings of single
digits.

Ge'

On Tue, 24 Mar 1998, Martin G. Diehl wrote:

> A simple algorithm (in Pseudo Pascal) would be:
>
> if NumberToConvert < 0 then
> result := '-0'
> else
> result := '0'; {result is a string}
> {digit is a character}
> while NumberToConvert <> 0 do
> begin
> digit := NumberToConvert mod 10;
> result := result + digit;
> NumberToConvert := NumberToConvert div 10;
> end;
>

Ge' Weijers Voice: (614)326 4600
Progressive Systems, Inc. FAX: (614)326 4601
2000 West Henderson Rd. Suite 400
Columbus, OH 43220 http://www.Progressive-Systems.com


New Message Reply About this list Date view Thread view Subject view Author view

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

The following archive was created by hippie-mail 7.98617-22 on Fri Aug 21 1998 - 17:16:16 ADT