From 2717c24f6ff5655e0e9fe561e690e0044e1a3bed Mon Sep 17 00:00:00 2001 From: nsz Date: Mon, 27 Feb 2012 21:42:03 +0100 Subject: [PATCH] libm: typesetting fixes --- libm/index.html | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/libm/index.html b/libm/index.html index abdd7f8..5832554 100644 --- a/libm/index.html +++ b/libm/index.html @@ -188,7 +188,11 @@ C does not require consistent evaluation precision: the compiler may store intermediate results and round them to double while keep other parts in higher precision. -So (a+b)==(a+b) may be false when the two sides +So +
+(a+b)==(a+b)
+
+may be false when the two sides are kept in different precision. (This is not an x87 specific problem, it matters whenever there is a higher precision fp type than the currently used one. @@ -202,8 +206,11 @@ C99 has a way to control this (see when a result is stored in a variable or a type cast is used, then it is guaranteed that the precision is appropriate to that type. -So in (double)(a+b)==(double)(a+b) both -sides are guaranteed to be in double precision +So in +
+(double)(a+b)==(double)(a+b)
+
+both sides are guaranteed to be in double precision when the comparision is done.

(This still does not solve the x87 double rounding @@ -300,11 +307,18 @@ in the libm code: scalbn even depends on signed int overflow.

  • Complex arithmetics

    -With gcc x*I turns into (x+0*I)*(0+I) = 0*x + x*I, -so if x=inf then the result is nan+inf*I instead of inf*I +gcc turns +

    +x*I
    +
    +into +
    +(x+0*I)*(0+I) = 0*x + x*I
    +
    +So if x=inf then the result is nan+inf*I instead of inf*I (an fmul instruction is generated for 0*x)

    -(There were various complex constant folding issues as well). +(There were various complex constant folding issues as well in gcc).

    So a+b*I cannot be used to create complex numbers, instead some double[2] manipulation should be used to -- 2.20.1