nsprpub/pr/tests/prfdbl.c

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

     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