nsprpub/pr/tests/prfdbl.c

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 /*
     6  * This is a simple test of the PR_fprintf() function for doubles.
     7  */
     9 #include "prprf.h"
    11 int main()
    12 {
    13     double pi = 3.1415926;
    14     double e = 2.71828;
    15     double root2 = 1.414;
    16     double zero = 0.0;
    17     double nan = zero / zero;
    19     PR_fprintf(PR_STDOUT, "pi is %f.\n", pi);
    20     PR_fprintf(PR_STDOUT, "e is %f.\n", e);
    21     PR_fprintf(PR_STDOUT, "The square root of 2 is %f.\n", root2);
    22     PR_fprintf(PR_STDOUT, "NaN is %f.\n", nan);
    24     PR_fprintf(PR_STDOUT, "pi is %301f.\n", pi);
    25     PR_fprintf(PR_STDOUT, "e is %65416.123f.\n", e);
    26     PR_fprintf(PR_STDOUT, "e is %0000000000000000000065416.123f.\n", e);
    27     PR_fprintf(PR_STDOUT, "NaN is %1024.1f.\n", nan);
    28     return 0;
    29 }

mercurial