\mbox{[}\mbox{]}() \mbox{[}\mbox{]}() \mbox{[}\mbox{]}()

\begin{quote}
A Java\+Script function to parse floating point hexadecimals as defined by the \href{https://webassembly.github.io/spec/core/text/values.html\#text-hexfloat}{\texttt{ Web\+Assembly specification}}. \end{quote}
\hypertarget{md_sfcode_node_modules__webassemblyjs_floating_point_hex_parser_README_autotoc_md2288}{}\doxysection{Usage}\label{md_sfcode_node_modules__webassemblyjs_floating_point_hex_parser_README_autotoc_md2288}

\begin{DoxyCode}{0}
\DoxyCodeLine{import parseHexFloat from '@webassemblyjs/floating-\/point-\/hex-\/parser'}
\DoxyCodeLine{}
\DoxyCodeLine{parseHexFloat('0x1p-\/1')               // 0.5}
\DoxyCodeLine{parseHexFloat('0x1.921fb54442d18p+2') // 6.283185307179586 }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules__webassemblyjs_floating_point_hex_parser_README_autotoc_md2289}{}\doxysection{Tests}\label{md_sfcode_node_modules__webassemblyjs_floating_point_hex_parser_README_autotoc_md2289}
This module is tested in two ways. The first one is through a small set of test cases that can be found in \href{https://github.com/maurobringolf/@webassemblyjs/floating-point-hex-parser/blob/master/test/regular.test.js}{\texttt{ test/regular.\+test.\+js}}. The second one is non-\/deterministic (sometimes called {\itshape fuzzing})\+:


\begin{DoxyEnumerate}
\item Generate a random IEEE754 double precision value {\ttfamily x}.
\end{DoxyEnumerate}
\begin{DoxyEnumerate}
\item Compute its representation {\ttfamily y} in floating point hexadecimal format using the C standard library function {\ttfamily printf} since C supports this format.
\end{DoxyEnumerate}
\begin{DoxyEnumerate}
\item Give both values to JS testcase and see if {\ttfamily parse\+Hex\+Float(y) === x}.
\end{DoxyEnumerate}

By default one {\ttfamily npm test} run tests 100 random samples. If you want to do more, you can set the environment variable {\ttfamily FUZZ\+\_\+\+AMOUNT} to whatever number of runs you\textquotesingle{}d like. Because it uses one child process for each sample, it is really slow though. For more details about the randomized tests see \href{https://github.com/maurobringolf/@webassemblyjs/floating-point-hex-parser/tree/master/test/fuzzing}{\texttt{ the source}}.\hypertarget{md_sfcode_node_modules__webassemblyjs_floating_point_hex_parser_README_autotoc_md2290}{}\doxysection{Links}\label{md_sfcode_node_modules__webassemblyjs_floating_point_hex_parser_README_autotoc_md2290}

\begin{DoxyItemize}
\item \href{https://maurobringolf.ch/2017/12/hexadecimal-floating-point-notation/}{\texttt{ maurobringolf.\+ch/2017/12/hexadecimal-\/floating-\/point-\/notation/}}
\item \href{https://github.com/xtuc/js-webassembly-interpreter/issues/32}{\texttt{ github.\+com/xtuc/js-\/webassembly-\/interpreter/issues/32}}
\item \href{https://github.com/WebAssembly/design/issues/292}{\texttt{ github.\+com/\+Web\+Assembly/design/issues/292}} 
\end{DoxyItemize}