File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,14 @@ that the value is not computable:
230
230
231
231
.. function :: void truth_println(truth_t x)
232
232
233
+ .. function :: truth_t gr_in_domain(int status)
234
+
235
+ Returns ``T_TRUE `` when ``status `` is ``GR_SUCCESS ``, ``T_FALSE `` when ``GR_DOMAIN `` is set but ``GR_UNABLE `` is not, and ``T_UNKNOWN `` otherwise.
236
+
237
+ .. function :: int gr_check(truth_t t)
238
+
239
+ Maps ``T_TRUE `` to ``GR_SUCCESS ``, ``T_FALSE `` to ``GR_DOMAIN ``, and ``T_UNKNOWN `` to ``GR_UNABLE ``.
240
+
233
241
Context operations
234
242
-------------------------------------------------------------------------------
235
243
Original file line number Diff line number Diff line change @@ -51,6 +51,31 @@ GR_INLINE truth_t truth_not(truth_t x)
51
51
return T_UNKNOWN ;
52
52
}
53
53
54
+ GR_INLINE truth_t gr_in_domain (int status )
55
+ {
56
+ if (status == GR_SUCCESS )
57
+ return T_TRUE ;
58
+ else if (status & GR_UNABLE )
59
+ return T_UNKNOWN ;
60
+ else if (status & GR_DOMAIN )
61
+ return T_FALSE ;
62
+ else
63
+ return T_UNKNOWN ;
64
+ }
65
+
66
+ GR_INLINE int gr_check (truth_t t )
67
+ {
68
+ switch (t )
69
+ {
70
+ case T_TRUE :
71
+ return GR_SUCCESS ;
72
+ case T_FALSE :
73
+ return GR_DOMAIN ;
74
+ case T_UNKNOWN :
75
+ return GR_UNABLE ;
76
+ }
77
+ }
78
+
54
79
GR_INLINE void truth_println (truth_t x )
55
80
{
56
81
if (x == T_TRUE ) flint_printf ("T_TRUE\n" );
You can’t perform that action at this time.
0 commit comments