Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* The Pentium Non-Bug
@ 1999-09-03 21:41 David McClain
  0 siblings, 0 replies; only message in thread
From: David McClain @ 1999-09-03 21:41 UTC (permalink / raw)
  To: caml-list

In light of my recent trip around the mulberry bush, I thought I would post
a preamble from some of my code for everyone's sake.

- DM

(* ------------------------------------------------------------ *)
(* Considerable care has been taken to be IEEE correct *)
(* in the face of distinct (+0.0) and (-0.0).          *)

(* The rules of the game are:                                        *)

(*    Addition       => commutative           a + b = b + a          *)
(*    Subtraction    => anticommutative       a - b = -(b - a)       *)
(*    Multiplication => commutative           a * b = b * a          *)
(*    Division       => inverse-commutative   a / b = 1.0 / (b / a)  *)

(*    Identity under addition:                                       *)
(*      x + (-0.0) = x   but  x + (+0.0) != x                        *)

(*    Identity under subtraction:                                    *)
(*      x - (+0.0) = x   but  x - (-0.0) != x                        *)

(*    Negation by subtraction:                                       *)
(*      (-0.0) - x = neg x (= FCHS x) but  (+0.0) - x != neg x       *)

(*    Equivalence of subtraction by addition of negative:            *)
(*      a - b = a + neg b                                            *)

(*    Distribution of negation:                                      *)
(*      a - b = -(b - a) = -b - (-a) = -b + a                        *)
(*        ;; remember that addition is commutative                   *)

(*    Complex conjugation by negation:                               *)
(*      conj(re,im) = (re, -im) != (re, 0 - im)                      *)

(* Since the constant 0.0 generally denotes (+0.0) and since it is   *)
(* generally difficult to determine the sign of a given              *)
(* zero constant value, one simply cannot assume that:               *)
(*     0.0 + x = x                                                   *)
(*     x - 0.0 = x                                                   *)
(*     0.0 - x = neg x                                               *)
(* Rather, one must carry out what appears to be a null operation,   *)
(* and be certain to negate when appropriate, instead of subtracting *)
(* from zero.                                                        *)






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-09-06  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-03 21:41 The Pentium Non-Bug David McClain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox