26 Oct 90 05:32:17 GMT

Related articles |
---|

[2 earlier articles] |

Re: IEEE 754 vs Fortran arithmetic henry@zoo.toronto.edu (1990-10-24) |

Re: IEEE 754 vs Fortran arithmetic tim@ksr.com (Tim Peters) (1990-10-24) |

Re: IEEE 754 vs Fortran arithmetic dik@cwi.nl (1990-10-25) |

Re: IEEE 754 vs Fortran arithmetic wsb@eng.Sun.COM (1990-10-25) |

Re: IEEE 754 vs Fortran arithmetic eggert@twinsun.com (1990-10-25) |

Re: IEEE 754 vs Fortran arithmetic wsb@eng.Sun.COM (1990-10-25) |

Re: IEEE 754 vs Fortran arithmetic sjc@key.COM (1990-10-26) |

Re: IEEE 754 vs Fortran arithmetic diamond@tkov50.enet.dec.com (1990-10-15) |

Re: IEEE 754 vs Fortran arithmetic tim@ksr.com (Tim Peters) (1990-10-27) |

Re: IEEE 754 vs Fortran arithmetic bsy+@CS.CMU.EDU (Bennet Yee) (1990-10-28) |

Re: IEEE 754 vs Fortran arithmetic mcohen@amsaa-seer.brl.mil (Marty Cohen) (1990-10-30) |

Newsgroups: | comp.compilers,comp.lang.fortran |

From: | sjc@key.COM (Steve Correll) |

Keywords: | Fortran |

Organization: | Key Computer Labs, Fremont, CA |

References: | <9010230628.AA22160@admin.ogi.edu> <BURLEY.90Oct24025053@world.std.com> |

Date: | 26 Oct 90 05:32:17 GMT |

In article <BURLEY.90Oct24025053@world.std.com>, burley@world.std.com (James C Burley) writes:

*> Also, Fortran specifically prohibits zero from being negative (or being*

*> significantly negative -- for example, I think, given that X is 0.0 and Y is*

*> -0.0, IEEE 754 specifies that (Y.LT.X) whereas Fortran specifies that*

*> (Y.EQ.X)). I might be wrong about the specifics...*

IEEE 754 says that -0 and +0 compare equal.

However, IEEE 754 introduces a host of problems because of NaNs. Compilers

which assume that .not.(x.gt.y) implies x.le.y, or that .not.(x.eq.y) implies

x.ne.y may founder on the IEEE requirement that NaN compares unordered (false)

with any other value. And the Fortran arithmetic IF is a particularly strange

case, since NaN is neither less than, nor equal to, nor greater than zero.

Thus IEEE technically requires three tests rather than two to implement this.

--

sjc@key.com or ...{sun,pyramid}!pacbell!key!sjc Steve Correll

[It is an interesting metaphysical problem to consider what an arithmetic IF

should do when confronted with a NaN. Fall through? Ugh. -John]

--

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.