\hypertarget{class_qore_1_1zzz8floatzzz9}{}\doxysection{Qore\+::zzz8floatzzz9 Class Reference}
\label{class_qore_1_1zzz8floatzzz9}\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}


Methods in this pseudo-\/class can be executed on \mbox{\hyperlink{basic_data_types_float}{floating-\/point values}}.  




{\ttfamily \#include $<$Pseudo\+\_\+\+QC\+\_\+\+Float.\+dox.\+h$>$}



Inheritance diagram for Qore\+::zzz8floatzzz9\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=140pt]{class_qore_1_1zzz8floatzzz9__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__type__conversion__functions_ga113d18216af1bdb70545081b6a9892ef}{float}} \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a2adeb1fcae50106e1a3ed4506d5b12ea}{abs}} ()
\begin{DoxyCompactList}\small\item\em Returns the absolute value of the number. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a456f92c6ee27c0c772223745f918bcbc}{format}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} fmt)
\begin{DoxyCompactList}\small\item\em Returns a string of a formatted number according to a format string. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a0a1ed20b3cbe9a7d99681b2ee1b4802b}{format}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} prec=2, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} decimal\+\_\+sep=\char`\"{}.\char`\"{}, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} thousands\+\_\+sep=\char`\"{}\char`\"{})
\begin{DoxyCompactList}\small\item\em Returns a formatted string of the floating-\/point number according to format arguments. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_aea0691501b3c4e0325034bd7a77f83fb}{infp}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the number is infinity (+ or -\/) \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a1e40df6b7e6d5cd5022081fbf0e6f446}{intp}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} because float values can be converted to integers. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_af592f928a4c796aeb82be290b7973f91}{nanp}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the number is NaN (not a number) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_ab12fc9ef4d1d45cbad74ac1558ec754e}{sign}} ()
\begin{DoxyCompactList}\small\item\em Returns -\/1 if the number is negative, 0 if it is zero, or 1 if it is positive. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_afb5c987609e1c65a363ad5252970da37}{strp}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} because float values can be converted to strings. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a138a6d9c7f0c10546c96a875bc29d242}{to\+Base}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} base=10)
\begin{DoxyCompactList}\small\item\em Converts the number to a different {\bfseries{base}} (and returns it as a string). \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a24f3f33fcd172c04cff733cc4f7628b5}{type\+Code}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{group__type__code__constants_ga8ac3e62bba7e8b878017533c2ac2f20f}{Qore\+::\+NT\+\_\+\+FLOAT}}. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a082fc22123e2519a8f6593a9683787ed}{val}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the float is non-\/zero, \mbox{\hyperlink{basic_data_types_False}{False}} if zero. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Methods in this pseudo-\/class can be executed on \mbox{\hyperlink{basic_data_types_float}{floating-\/point values}}. 

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_a2adeb1fcae50106e1a3ed4506d5b12ea}\label{class_qore_1_1zzz8floatzzz9_a2adeb1fcae50106e1a3ed4506d5b12ea}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!abs@{abs}}
\index{abs@{abs}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{abs()}{abs()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga113d18216af1bdb70545081b6a9892ef}{float}} Qore\+::zzz8floatzzz9\+::abs (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the absolute value of the number. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{f = f.abs();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the absolute value of the number
\end{DoxyReturn}
\begin{DoxyNote}{Note}
equivalent to abs(float)
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+8 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_a0a1ed20b3cbe9a7d99681b2ee1b4802b}\label{class_qore_1_1zzz8floatzzz9_a0a1ed20b3cbe9a7d99681b2ee1b4802b}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!format@{format}}
\index{format@{format}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{format()}{format()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::zzz8floatzzz9\+::format (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{prec = {\ttfamily 2},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{decimal\+\_\+sep = {\ttfamily \char`\"{}.\char`\"{}},  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{thousands\+\_\+sep = {\ttfamily \char`\"{}\char`\"{}} }\end{DoxyParamCaption})}



Returns a formatted string of the floating-\/point number according to format arguments. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em prec} & the number of digits after the decimal point; a negative value means to round that number of digits before the decimal place, whereas the special constant \mbox{\hyperlink{group__number__string__formatting__constants_gab4b7a40f77ac14951ab6f04229a7bb6b}{SNF\+\_\+\+All\+Digits}} means to include all possible digits after the decimal point \\
\hline
{\em decimal\+\_\+sep} & a single character that defines the decimal separator; an empty string means no decimal separator \\
\hline
{\em thousands\+\_\+sep} & a single character that defines the thousands and further separators every three digits before the decimal point; an empty string means no thousands separator\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a string representing the floating-\/point number according to the format arguments as described above
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{number n = -\/48392093894.2349n;}
\DoxyCodeLine{string nstr = n.format(3, \textcolor{stringliteral}{"{}."{}}, \textcolor{stringliteral}{"{},"{}}); \textcolor{comment}{\# returns "{}-\/48.392.093.894,235"{}}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1zzz8numberzzz9_a31013414002c3808718a217d8d488f7b}{Qore\+::zzz8numberzzz9\+::format(int, string, string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8intzzz9_a52e3a4df1cf57a32686d651666a9643a}{Qore\+::zzz8intzzz9\+::format(int, string, string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8numberzzz9_acdcee3a4130b680892d915f3956f8199}{Qore\+::zzz8numberzzz9\+::format(string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a456f92c6ee27c0c772223745f918bcbc}{Qore\+::zzz8floatzzz9\+::format(string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8intzzz9_a4f4b203fef4e2ae785f838c98e5995be}{Qore\+::zzz8intzzz9\+::format(string)}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_a456f92c6ee27c0c772223745f918bcbc}\label{class_qore_1_1zzz8floatzzz9_a456f92c6ee27c0c772223745f918bcbc}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!format@{format}}
\index{format@{format}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{format()}{format()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::zzz8floatzzz9\+::format (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{fmt }\end{DoxyParamCaption})}



Returns a string of a formatted number according to a format string. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em fmt} & the format string has the following format\+:~\newline
 {\itshape \texorpdfstring{$<$}{<}thousands\+\_\+separator\texorpdfstring{$>$}{>}}{\ttfamily \mbox{[}}{\itshape \texorpdfstring{$<$}{<}decimal\+\_\+separator\texorpdfstring{$>$}{>}\mbox{[}\texorpdfstring{$<$}{<}decimals\texorpdfstring{$>$}{>}\mbox{]}}{\ttfamily \mbox{]}}~\newline
 where\+:~\newline

\begin{DoxyItemize}
\item {\itshape thousands\+\_\+separator} and {\itshape decimal\+\_\+separator} are single characters defining the thousands and decimal separator characters respectively, and
\item {\itshape decimals} is one or more digits defining how may decimals should appear after the decimal point; a negative number means to round that number of digits before the decimal place
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a string of a formatted number according to a format string; if the format string does not follow the given format, then the number without formatting is returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{float f = -\/48392093894.2349;}
\DoxyCodeLine{string nstr = f.format(\textcolor{stringliteral}{"{}.,3"{}}); \textcolor{comment}{\# returns "{}-\/48.392.093.894,235"{}}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
equivalent to \mbox{\hyperlink{group__string__functions_ga33bb08516773ed10def16bb42d6b8159}{format\+\_\+number(string, softfloat)}}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{class_qore_1_1zzz8intzzz9_a4f4b203fef4e2ae785f838c98e5995be}{Qore\+::zzz8intzzz9\+::format(string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8numberzzz9_acdcee3a4130b680892d915f3956f8199}{Qore\+::zzz8numberzzz9\+::format(string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8intzzz9_a52e3a4df1cf57a32686d651666a9643a}{Qore\+::zzz8intzzz9\+::format(int, string, string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8floatzzz9_a0a1ed20b3cbe9a7d99681b2ee1b4802b}{Qore\+::zzz8floatzzz9\+::format(int, string, string)}}
\item \mbox{\hyperlink{class_qore_1_1zzz8numberzzz9_a31013414002c3808718a217d8d488f7b}{Qore\+::zzz8numberzzz9\+::format(int, string, string)}}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_aea0691501b3c4e0325034bd7a77f83fb}\label{class_qore_1_1zzz8floatzzz9_aea0691501b3c4e0325034bd7a77f83fb}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!infp@{infp}}
\index{infp@{infp}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{infp()}{infp()}}
{\footnotesize\ttfamily bool Qore\+::zzz8floatzzz9\+::infp (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the number is infinity (+ or -\/) 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if the number is infinity (+ or -\/)
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if} (f.infp())}
\DoxyCodeLine{    print(\textcolor{stringliteral}{"{}the operation resulted in infinity\(\backslash\)n"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_a1e40df6b7e6d5cd5022081fbf0e6f446}\label{class_qore_1_1zzz8floatzzz9_a1e40df6b7e6d5cd5022081fbf0e6f446}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!intp@{intp}}
\index{intp@{intp}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{intp()}{intp()}}
{\footnotesize\ttfamily bool Qore\+::zzz8floatzzz9\+::intp (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{basic_data_types_True}{True}} because float values can be converted to integers. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} because float values can be converted to integers
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if} (n.intp())}
\DoxyCodeLine{    printf(\textcolor{stringliteral}{"{}\%y: can be converted to an integer: \%d\(\backslash\)n"{}}, n, int(n));}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_af592f928a4c796aeb82be290b7973f91}\label{class_qore_1_1zzz8floatzzz9_af592f928a4c796aeb82be290b7973f91}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!nanp@{nanp}}
\index{nanp@{nanp}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{nanp()}{nanp()}}
{\footnotesize\ttfamily bool Qore\+::zzz8floatzzz9\+::nanp (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the number is NaN (not a number) 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if the number is NaN (not a number)
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if} (f.nanp())}
\DoxyCodeLine{    print(\textcolor{stringliteral}{"{}the operation resulted in NaN\(\backslash\)n"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_ab12fc9ef4d1d45cbad74ac1558ec754e}\label{class_qore_1_1zzz8floatzzz9_ab12fc9ef4d1d45cbad74ac1558ec754e}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!sign@{sign}}
\index{sign@{sign}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{sign()}{sign()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::zzz8floatzzz9\+::sign (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns -\/1 if the number is negative, 0 if it is zero, or 1 if it is positive. 

\begin{DoxyReturn}{Returns}
-\/1 if the number is negative, 0 if it is zero, or 1 if it is positive
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{printf(\textcolor{stringliteral}{"{}sign: \%d\(\backslash\)n"{}}, f.sign());}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_afb5c987609e1c65a363ad5252970da37}\label{class_qore_1_1zzz8floatzzz9_afb5c987609e1c65a363ad5252970da37}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!strp@{strp}}
\index{strp@{strp}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{strp()}{strp()}}
{\footnotesize\ttfamily bool Qore\+::zzz8floatzzz9\+::strp (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{basic_data_types_True}{True}} because float values can be converted to strings. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} because float values can be converted to strings
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if} (n.strp())}
\DoxyCodeLine{    printf(\textcolor{stringliteral}{"{}\%y: can be converted to a string: '\%s'\(\backslash\)n"{}}, n, string(n));}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_a138a6d9c7f0c10546c96a875bc29d242}\label{class_qore_1_1zzz8floatzzz9_a138a6d9c7f0c10546c96a875bc29d242}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!toBase@{toBase}}
\index{toBase@{toBase}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{toBase()}{toBase()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::zzz8floatzzz9\+::to\+Base (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{base = {\ttfamily 10} }\end{DoxyParamCaption})}



Converts the number to a different {\bfseries{base}} (and returns it as a string). 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em base} & the base to convert the number to; this value must be 2 -\/ 36 inclusive or an {\ttfamily INVALID-\/\+BASE} exception will be thrown\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the converted value as a string
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{ (15.5).toBase(20));   // returns \textcolor{stringliteral}{"{}F.A"{}}}
\DoxyCodeLine{(-\/13.8).toBase(20));   // returns \textcolor{stringliteral}{"{}-\/D.G"{}}}
\DoxyCodeLine{(21.48).toBase(15));   // returns \textcolor{stringliteral}{"{}16.73"{}}}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em INVALID-\/\+BASE} & the base is invalid; must be 2 -\/ 36 inclusive\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1zzz8intzzz9_a1a7c8f41ba26bec22c1a0f485d90a48a}{Qore\+::zzz8intzzz9\+::to\+Base(int base)}} 

\mbox{\hyperlink{class_qore_1_1zzz8numberzzz9_ae6d52cb434c6eef372ef064852038f8a}{Qore\+::zzz8numberzzz9\+::to\+Base(int base)}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_a24f3f33fcd172c04cff733cc4f7628b5}\label{class_qore_1_1zzz8floatzzz9_a24f3f33fcd172c04cff733cc4f7628b5}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!typeCode@{typeCode}}
\index{typeCode@{typeCode}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{typeCode()}{typeCode()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::zzz8floatzzz9\+::type\+Code (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{group__type__code__constants_ga8ac3e62bba7e8b878017533c2ac2f20f}{Qore\+::\+NT\+\_\+\+FLOAT}}. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__type__code__constants_ga8ac3e62bba7e8b878017533c2ac2f20f}{Qore\+::\+NT\+\_\+\+FLOAT}}
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{switch (f.typeCode()) \{}
\DoxyCodeLine{    case NT\_FLOAT:}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%y: is a float\(\backslash\)n"{}}, f);}
\DoxyCodeLine{        \textcolor{keywordflow}{break};}
\DoxyCodeLine{\}}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1zzz8floatzzz9_a082fc22123e2519a8f6593a9683787ed}\label{class_qore_1_1zzz8floatzzz9_a082fc22123e2519a8f6593a9683787ed}} 
\index{Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}!val@{val}}
\index{val@{val}!Qore::zzz8floatzzz9@{Qore::zzz8floatzzz9}}
\doxysubsubsection{\texorpdfstring{val()}{val()}}
{\footnotesize\ttfamily bool Qore\+::zzz8floatzzz9\+::val (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the float is non-\/zero, \mbox{\hyperlink{basic_data_types_False}{False}} if zero. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if the float is non-\/zero, \mbox{\hyperlink{basic_data_types_False}{False}} if zero
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool b = f.val();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \mbox{\hyperlink{parse_directives_perl-bool-eval}{\%perl-\/bool-\/eval}}
\item \mbox{\hyperlink{parse_directives_strict-bool-eval}{\%strict-\/bool-\/eval}} 
\end{DoxyItemize}
\end{DoxySeeAlso}
