flat assembler
Message board for the users of flat assembler.

Index > Main > Convert double to string and back.

Author
Thread Post new topic Reply to topic
dmitriy566



Joined: 19 Jun 2012
Posts: 27
Location: Saint-Petersburg, Russia
dmitriy566
Hello!
I need two procs: converting from double fpu to string and back.
I will be very glad if you give me a good realisations of these procs.
Thank you.
Post 22 May 2015, 15:11
View user's profile Send private message Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 555
fasmnewbie
You can use C's printf, or if you share FASMers' spirit, you can create your own. You can also check out the Example & Tutorial section. Lots of examples there. Good luck.
Post 22 May 2015, 18:11
View user's profile Send private message Visit poster's website Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 365
Location: Australia
redsock
Depending on requirements, this is often a non-trivial task... in my own library, I implemented the http://www.cs.indiana.edu/~dyb/pubs/FP-Printing-PLDI96.pdf method, which is slower than the "standard method" but provides string <-> double <-> string <-> double without rounding/loss issues (a messy but required bit that I needed).

The guts of mine are from_double and to_double at https://2ton.com.au/library_as_html/string32.inc.html

Cheers
Post 23 May 2015, 00:26
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.