Qore Programming Language Reference Manual  0.8.9
 All Classes Namespaces Functions Variables Groups Pages
Pseudo_QC_Number.dox.h
1 namespace Qore {
4 
5 class <number> : public <value> {
6 
7 public:
9 
23 number abs();
24 
25 public:
27 
50 string format(string fmt);
51 
52 public:
54 
67 bool infp();
68 
69 public:
71 
84 bool intp();
85 
86 public:
88 
101 bool nanp();
102 
103 public:
105 
117 int prec();
118 
119 public:
121 
133 int sign();
134 
135 public:
137 
150 bool strp();
151 
152 public:
154 
163 string toString(int fmt);
164 
165 public:
167 
183 int typeCode();
184 
185 public:
187 
203 bool val();
204 };
208 
210  const NF_Default = QORE_NF_DEFAULT;
212 
218  const NF_Raw = QORE_NF_RAW;
220  const NF_Scientific = QORE_NF_SCIENTIFIC;
222 };
bool nanp()
Returns True if the number is NaN (not a number)
const NF_Default
for the default format with a rounding heuristic to try to remove noise in insignificant digits from ...
Definition: Pseudo_QC_Number.dox.h:210
Methods in this pseudo-class are available to be executed on any value type (even NOTHING); this is t...
Definition: Pseudo_QC_All.dox.h:5
int prec()
Returns the precision of the current number.
number number(softnumber n)
Converts the argument to a number value.
bool strp()
Returns True because number values can be converted to strings.
int typeCode()
Returns Qore::NT_NUMBER.
bool infp()
Returns True if the number is infinity (+ or -)
bool intp()
Returns True because number values can be converted to integers.
const NF_Raw
for the raw format without the noise reduction heuristic in the NF_Default format ...
Definition: Pseudo_QC_Number.dox.h:218
number abs()
Returns the absolute value of the number.
int sign()
Returns -1 if the number is negative, 0 if it is zero, or 1 if it is positive.
const NF_Scientific
for the scientific format (exponential notation)
Definition: Pseudo_QC_Number.dox.h:220
Methods in this pseudo-class can be executed on arbitrary precision number values.
Definition: Pseudo_QC_Number.dox.h:5
string format(string fmt)
Returns a string of a formatted number according to a format string.
string toString()
Returns the string representation of the value; the default is an empty string.
bool val()
Returns True if the number is non-zero, False if zero.