resetting manifest requested domain to floor
[platform/upstream/mpc.git] / tests / strtoc.dat
1 # Data file for mpc_strtoc.
2 #
3 # Copyright (C) 2009 INRIA
4 #
5 # This file is part of GNU MPC.
6 #
7 # GNU MPC is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU Lesser General Public License as published by the
9 # Free Software Foundation; either version 3 of the License, or (at your
10 #o ption) any later version.
11 #
12 # GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 # more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with this program. If not, see http://www.gnu.org/licenses/ .
19 #
20 # The format respects the parameter order in function prototype as follow:
21 #
22 # INEX_RE INEX_IM PREC_ROP_RE  ROP_RE  PREC_ROP_IM  ROP_IM  "NSTRING" "RSTRING" BASE  RND_RE  RND_IM
23 #
24 # The string NSTRING is considered as a complex number rop = rop1 + i*rop2
25 # written in base BASE. The remainder of the string, i.e. non-whitespace
26 # characters being not part of the number, is equal to RSTRING.
27 #
28 # ROP_RE is checked against rop1 rounded to the precision PREC_ROP_RE
29 #   in the direction RND_RE
30 # ROP_IM is checked against rop2 rounded to the precision PREC_ROP_IM
31 #   in the direction RND_IM
32 # INEX_RE is the ternary value for the real part with the following notation:
33 # "?" ternary value not checked
34 # "!" function should return error indicator -1
35 # "+" if ROP_RE is greater than the exact mathematical result
36 # "0" if ROP_RE is exactly the mathematical result
37 # "-" if ROP_RE is less than the exact mathematical result
38 # (m.m. INEX_IM)
39 # rounding modes notation:
40 # "N" is rounding to nearest
41 # "Z" is rounding towards zero
42 # "U" is rounding towards plus infinity
43 # "D" is rounding towards minus infinity
44 # Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
45 #   no prefix for value in base ten.
46 # In all bases, "nan" is NaN, "inf" is infinity;
47 # The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
48
49 # invalid base
50 ! ! 53 nan 53 nan      "(1 1)"                    "(1 1)"          99 N N
51 ! ! 53 nan 53 nan      "(1 1)"                    "(1 1)"           1 N N
52
53 # invalid strings
54 ! ! 53 nan 53 nan      ""                         ""               10 N N
55 ! ! 53 nan 53 nan      "non"                      "non"            10 N N
56 ! ! 53 nan 53 nan      "NON"                      "NON"            10 N N
57 ! ! 53 nan 53 nan      "N A N"                    "N A N"          10 N N
58 ! ! 53 nan 53 nan      "(1) 1"                    "(1) 1"          10 N N #no imaginary part
59 ! ! 53 nan 53 nan      "."                        "."              10 N N
60 ! ! 53 nan 53 nan      ". 1"                      ". 1"            10 N N #no space allowed here
61 ! ! 53 nan 53 nan      "+ 1"                      "+ 1"             2 N N #no space allowed here
62 ! ! 53 nan 53 nan      "+3 "                      "+3 "             2 N N #invalid digit
63 ! ! 53 nan 53 nan      "+ INF "                   "+ INF "         10 N N #no space allowed here
64 ! ! 53 nan 53 nan      "( +INF)"                  "( +INF)"        10 N N
65 ! ! 53 nan 53 nan      "(1 +1 "                   "(1 +1 "         10 N N
66 ! ! 53 nan 53 nan      "(1+1)"                    "(1+1)"          10 N N
67 ! ! 53 nan 53 nan      "(1 + 1)"                  "(1 + 1)"        10 N N
68 ! ! 53 nan 53 nan      "(@nan@(quiet)"            "(@nan@(quiet)"  10 N N
69 ! ! 53 nan 53 nan      "zero"                     "zero"           10 N N
70 ! ! 53 nan 53 nan      "&^+"                      "&^+"            10 N N
71 ! ! 53 nan 53 nan      "i"                        "i"              18 N N
72 ! ! 53 nan 53 nan      "I"                        "I"              18 N N
73 ! ! 53 nan 53 nan      "z"                        "z"              35 N N
74 ! ! 53 nan 53 nan      "Z"                        "Z"              35 N N
75 ! ! 53 nan 53 nan      "(i 0)"                    "(i 0)"          18 N N
76 ! ! 53 nan 53 nan      "(I 0)"                    "(I 0)"          18 N N
77 ! ! 53 nan 53 nan      "(z 0)"                    "(z 0)"          35 N N
78 ! ! 53 nan 53 nan      "(Z 0)"                    "(Z 0)"          35 N N
79 ! ! 53 nan 53 nan      "(0 i)"                    "(0 i)"          18 N N
80 ! ! 53 nan 53 nan      "(0 I)"                    "(0 I)"          18 N N
81 ! ! 53 nan 53 nan      "(0 z)"                    "(0 z)"          35 N N
82 ! ! 53 nan 53 nan      "(0 Z)"                    "(0 Z)"          35 N N
83
84 # special values
85 0 0 53  nan 53   +0    "nan"                      ""               10 N N
86 0 0 53 +nan 53   +0    "+NAN"                     ""               10 N N
87 0 0 53  nan 53   +0    "  @NAN@  "                "  "             10 N N
88 0 0 53  nan 53  nan    "(@nan@(QUIET) nan)"       ""               10 N N
89 0 0 53  nan 53   +0    "@nan@(quiet"              "(quiet"         10 N N
90 0 0 53  nan 53   +0    "NaN((keep out))"          "((keep out))"   10 N N
91 0 0 53  nan 53   +0    "nan(0 1)"                 "(0 1)"          10 N N
92 0 0 53  nan 53   +0    "nan(0-1)"                 "(0-1)"          10 N N
93 0 0 53  nan 53   +0    "nan(0_1)"                 ""               10 N N
94 0 0 53  nan 53   +0    " nan nan nan nan"         " nan nan nan"   10 N N
95 0 0 53  inf 53   +0    "inf"                      ""               10 N N
96 0 0 53 -inf 53   +0    "-inf"                     ""               10 N N
97 0 0 53 +inf 53   +0    "       infinity"          ""               10 N N
98 0 0 53 +inf 53   +0    "+INF            x"        "            x"  10 N N
99 0 0 53   +0 53 +inf    "(0 +inf)"                 ""               10 N N
100 0 0 53   +0 53 +inf    "  (+0 INF)  "             "  "             10 N N
101 0 0 53   +0 53 -inf    "(0 -infinity)"            ""               10 N N
102 0 0 53   +0 53 -inf    "  (+0 -INF)"              ""               10 N N
103 0 0 53 -inf 53   -0    " (-@inf@ -0)"             ""               10 N N
104 0 0 53 +inf 53  nan    "(+inf nan(9u137))     "   "     "          10 N N
105 0 0 53  nan 53   +0    "NaN  + inf"               "  + inf"        10 N N
106
107 # pure real argument
108 0 0 53                     +0 53 +0    "0"                 ""      10 N N
109 0 0 53                     +0 53 +0    "00000"             ""      10 N N
110 0 0 53                     +0 53 +0    "+0"                ""      10 N N
111 0 0 53                     -0 53 +0    "-0"                ""      10 N N
112 0 0 53                     +1 53 +0    "1"                 ""      10 N N
113 0 0 53                     +1 53 +0    "001"               ""      10 N N
114 0 0 53                     +1 53 +0    "1 +1"              " +1"   10 N N
115 0 0 53                     +1 53 +0    "1a"                "a"     10 N N
116 0 0 53                     +1 53 +0    "1e-"               "e-"    10 N N
117 0 0 53                     +1 53 +0    "1+2"               "+2"    10 N N
118 - 0 53   +0x9D70A3D70A3D7p-51 53 +0    "(+1.23 0.0)"       ""      10 N N
119 0 0 53                    -10 53 +0    "(-10. 0000) "      " "     10 N N
120 0 0 53                +0x5p-3 53 -0    "(.625 -0)"         ""      10 N N
121 - 0 53 +0x14E718D7D7625Ap+612 53 +0    "(1e200  0)"        ""      10 N N
122 0 0 53                +0x7530 53 +0    " (3e+4 0)"         ""      10 N N
123 - 0 53  +0x10C6F7A0B5ED8Dp-73 53 +0    ".5e-6"             ""      10 N N
124 - 0 53  +0x1B1C1E0D914133p-83 53 +0    "(7.89E-10 0)"      ""      10 N N
125 + 0 53  -0x7B426FAB61F00Cp+56 53 +0    "  -25@+32"         ""      10 N N
126 0 0 53                    -25 53 +0    "-25p+32"           "p+32"  10 N N
127 0 0 53                 +43981 53 +0    "0xabcd"            ""      16 N N
128 0 0 53                     +0 53 +0    "0xabcd"            "xabcd" 10 N N #no prefix in base ten
129 0 0 53                     +2 53 +0    "+0b010"            ""       2 N N
130 0 0 53                     +0 53 +0    "+0b010"            "b010"  10 N N #no prefix in base ten
131 0 0 53                     +1 53 +0    "1*i"               "*i"    10 N N
132 0 0 53                    +18 53 +0    "i*i"               "*i"    20 N N
133 0 0 53 18 53 0                         "i"                   ""    19 N N
134 0 0 53 35 53 0                         "z"                   ""    36 N N
135 0 0 53 35 53 0                         "Z"                   ""    36 N N
136
137 # pure imaginary argument
138 0 0 53 +0 53                     +1    "(0 1)"               ""    10 N N
139 0 0 53 +0 53                     +1    "(0 +1)"              ""    20 N N
140 0 0 53 -0 53                     -1    "  (-0 -1)"           ""    10 N N
141 0 0 53 -0 53                     -2    "(-0 -2)   "          "   " 10 N N
142 0 0 53 +0 53                     +2    "(+0 2)"              ""    10 N N
143 0 0 53 +0 53                    +17    "(0 h)"               ""    20 N N
144 0 0 53 +0 53                    +18    "(0 i)"               ""    20 N N
145 0 + 53 +0 53  -0x14F800008637BDp-44    "(0 -33.55000005e+1)" ""    10 N Z
146 0 + 53 +0 53  -0xA1765976008AFp-401    "(+0 -.550000E-105) " " "   10 N U
147 0 0 53 0 53 18                         "(0 i)"               ""    19 N N
148 0 0 53 0 53 18                         "(0 I)"               ""    19 N N
149 0 0 53 0 53 35                         "(0 z)"               ""    36 N N
150 0 0 53 0 53 35                         "(0 Z)"               ""    36 N N
151
152 # complex argument
153 0 0 53            +1 53          +1    "(  1   +1)"          ""    10 N N
154 0 0 53            +1 53          +1    " (1   +1)     "      "     " 10 N N
155 0 0 53            +7 53         +14    "(7  14)"             ""    10 N N
156 0 0 53           +17 53          +1    "(+17 1)"             ""    10 N N
157 0 0 53           +27 53          +1    " (+17 +1)"           ""    20 N N
158 0 0 53           -18 53          -1    "(-i -1)"             ""    20 N N
159 0 0 53           +18 53          -1    "(i -1)"              ""    20 N N
160 0 0 53           -18 53          +1    "(-i +1)"             ""    20 N N
161 0 0 53           +18 53         +18    "(i +i)"              ""    20 N N
162 0 0 53        -14643 53      +20328    "(-bar foo)"          ""    36 N N
163 0 0 53      -1647190 53     -512315    "(-zaza -azaz)"       ""    36 N N
164 0 0 53       +0b1010 53     +0xabcd    "(0b1010 +0xabcd)"    ""     0 N N #base autodetection
165 0 0 53       +0xabcd 53     +0b1010    "(+0xa.bcd@+3 0b.101p4)" ""  0 N N #base autodetection
166
167 # white space before the closing ')'
168 0 0 53            +1 53          +1    "(  1   +1   )1"      "1"    10 N N