24 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* $Id: float_emul.c,v 1.7 2006/03/30 19:36:03 debug Exp $ |
* $Id: float_emul.c,v 1.8 2006/09/07 11:44:01 debug Exp $ |
28 |
* |
* |
29 |
* Floating point emulation routines. |
* Floating point emulation routines. |
30 |
*/ |
*/ |
232 |
|
|
233 |
/* |
/* |
234 |
* How to convert back from double to exponent + fraction: |
* How to convert back from double to exponent + fraction: |
235 |
* We want fraction to be 1.xxx, that is |
* The fraction should be 1.xxx, that is |
236 |
* 1.0 <= fraction < 2.0 |
* 1.0 <= fraction < 2.0 |
237 |
* |
* |
238 |
* This method is very slow but should work: |
* This method is very slow but should work: |
239 |
|
* (TODO: Fix the performance problem!) |
240 |
*/ |
*/ |
241 |
exponent = 0; |
exponent = 0; |
242 |
while (nf < 1.0 && exponent > -1023) { |
while (nf < 1.0 && exponent > -1023) { |