Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
A simple approach is to just load the mantissa, append the leading one, then shift based on the exponent and hope it doesnt overflow a long long int.
Try browsing a libc's source to find out a more complete approach.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
pcmattman wrote:Solar, does your PDCLIB have 64-bit arithmetic and a dtoa function??
No float logic in PDCLib yet. 64bit-support is up to the compiler environment, dtoa() isn't a standard function - you'd have to use sprintf(), or use whatever internal function I will be using for the actual conversion - which would make your code PDCLib-specific and non-portable.
The problem with dtoa()-like functions is that they have to handle values off the sunny path (INF, NaN, ...).
Every good solution is obvious once you've found it.
pcmattman wrote:Hmmm... I just realized a problem. I can't do arithmetic on 64-bit numbers. I get complaints about undefined functions - umod??
Have you got / built (cross-compiler) libgcc and have you tried linking it in?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]