The MASM Forum

General => The Laboratory => Topic started by: jj2007 on February 12, 2022, 06:34:43 AM

Title: Double to string conversion
Post by: jj2007 on February 12, 2022, 06:34:43 AM
To my surprise, I can find only one confused thread in the Lab (http://masm32.com/board/index.php?topic=1859.0) that deals with double to string conversion. Did Rui's efforts ever result in a consensus about the best algo? If yes, which one? I attach his archive, hoping that somebody can decipher it :cool:
Title: Re: Double to string conversion
Post by: HSE on February 12, 2022, 07:36:30 AM
Quote from: jj2007 on February 12, 2022, 06:34:43 AM
I can find only one confused thread in the Lab[/url] that deals with double to string conversion

Perhaps because double don't exist in assembly  :biggrin:
Title: Re: Double to string conversion
Post by: jj2007 on February 12, 2022, 02:41:59 PM
Good point :biggrin:

http://masm32.com/board/index.php?topic=9316.0

(googling for site:masm32.com REAL8 string convert)

Unfortunately, JK's code requires a non-standard Masm installation to assemble. Bad luck :sad:
Title: Re: Double to string conversion
Post by: JK on February 12, 2022, 07:28:07 PM
Hi jj2007,

it shouldn´t be too hard to make it assemble with a standard Masm installation - i´m sure you can do it.
There is also similar code in Raymond´s FPU Lib. The mathematical approach is essentially the same, while the implementation is slightly different.
Title: Re: Double to string conversion
Post by: HSE on February 13, 2022, 12:53:13 AM
Quote from: JK on February 12, 2022, 07:28:07 PM
it shouldn´t be too hard to make it assemble with a standard Masm installation
No problem. Tested in 32 bits

Quote from: JK on February 12, 2022, 07:28:07 PM
There is also similar code in Raymond´s FPU Lib. The mathematical approach is essentially the same, while the implementation is slightly different.
Also there is an adaptation of Raymond's procedure maked by Biterider in ObjAsm library.
Title: Re: Double to string conversion
Post by: jj2007 on February 13, 2022, 01:31:50 AM
Quote from: JK on February 12, 2022, 07:28:07 PM
it shouldn´t be too hard to make it assemble with a standard Masm installation - i´m sure you can do it.

Hi Juergen,

HSE was faster - thanks :thup:

I don't have much time, and am working on another project, so the fastest REAL8 to string algo is on ice for me now :sad: