flat assembler
Message board for the users of flat assembler.
Index
> Windows > Creating a constant float from a string |
Author |
|
LocoDelAssembly 02 Oct 2011, 18:56
Quote:
Code: num= load_integer_part() divisor = 10.0 for each fractional digit in forward direction do num = num + ascii_to_float(digit) / divisor divisor = divisor * 10 od |
|||
02 Oct 2011, 18:56 |
|
NanoBytes 02 Oct 2011, 20:22
Hmmm, I like that, much simpler than I presumed, thanks, Ill try it
|
|||
02 Oct 2011, 20:22 |
|
bitRAKE 02 Oct 2011, 20:25
Using FBLD / FBSTP would be an easy lesser alternative. Multiple digits can be converted simultaneously and then a single division used to scale integer based on decimal point.
http://www.website.masmforum.com/tutorials/fptute/fpuchap6.htm |
|||
02 Oct 2011, 20:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.