| Qore Programming Language Reference Manual 2.2.0

Loading...
Searching...
No Matches
Pseudo_QC_Float.dox.h
1
3 namespace Qore {
5/***/
6 class <float> : public <value> {
7
8 public:
10
24 float abs();
25
26 public:
28
63 string format(string fmt);
64
65 public:
67
91 string format(int prec = 2, string decimal_sep = ".", string thousands_sep = "");
92
93 public:
95
108 bool infp();
109
110 public:
112
123 bool intp();
124
125 public:
127
140 bool nanp();
141
142 public:
144
156 int sign();
157
158 public:
160
171 bool strp();
172
173 public:
175
196 string toBase(int base = 10);
197
198 public:
200
214 int typeCode();
215
216 public:
218
232 bool val();
233};
234}
<float>
Methods in this pseudo-class can be executed on floating-point values.
Definition Pseudo_QC_Float.dox.h:6
<float>::val
bool val()
Returns True if the float is non-zero, False if zero.
<float>::format
string format(int prec=2, string decimal_sep=".", string thousands_sep="")
Returns a formatted string of the floating-point number according to format arguments.
<float>::toBase
string toBase(int base=10)
Converts the number to a different base (and returns it as a string).
<float>::intp
bool intp()
Returns True because float values can be converted to integers.
<float>::typeCode
int typeCode()
Returns Qore::NT_FLOAT.
<float>::abs
float abs()
Returns the absolute value of the number.
<float>::format
string format(string fmt)
Returns a string of a formatted number according to a format string.
<float>::sign
int sign()
Returns -1 if the number is negative, 0 if it is zero, or 1 if it is positive.
<float>::infp
bool infp()
Returns True if the number is infinity (+ or -)
<float>::nanp
bool nanp()
Returns True if the number is NaN (not a number)
<float>::strp
bool strp()
Returns True because float values can be converted to strings.
<value>
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:6
Qore
main Qore-language namespace
Definition Pseudo_QC_All.dox.h:3