Re: Float to ASCII - the classic ftoa();



On 26 Apr 2006 22:19:32 -0700, Chewy509@xxxxxxxxxxxxxxxx wrote:


Just to clarify my initial thoughts about how to write a ftoa();
routine that is accurate (eg unlimited decimal places - well up to what
the x86 FPU can handle) and can handle NaNs, etc gracefully, does
someone have any pointers or tutorials specifically aimed to
ascii->fp->ascii conversion routines and the IEEE754 format.

how many bits are IEEE754, are they 80 bits?

eg,
fld [my_fp_value]
mov rdi, my_string_buffer
mov rax, 50 ;; minimum 50 decimal places
call ftoa

string would be 1.000...00e100, with 50 zeros between '1.' and the 'e'.
.