Skip to content

Commit

Permalink
Allow C and Java native text spellings of NaN and infinities (#409)
Browse files Browse the repository at this point in the history
C's printf doesn't output mixed case, while Java's Double.valueOf and
Double.toString parse/output only `Infinity`, not `Inf`. Rather than
requiring special-case code for both input and output in both languages,
relax the VCF specification to allow NAN/INF/INFINITY case-insensitively.

(Add "IEEE-754" to be specific and to improve the line breaks.)
  • Loading branch information
jmarshall authored and Cristina Yenyxe Gonzalez Garcia committed Aug 22, 2019
1 parent 035946a commit 2e0f38c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion VCFv4.3.tex
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ \subsection{Character encoding, non-printable characters and characters with spe


\subsection{Data types}
Data types supported by VCF are: Integer (32-bit, signed), Float (32-bit, formatted to match the regular expression \verb|^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$|, \texttt{NaN}, or \texttt{+/-Inf}), Flag, Character, and String.
Data types supported by VCF are: Integer (32-bit, signed), Float (32-bit IEEE-754, formatted to match one of the regular expressions \verb|^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$| or \verb"^[-+]?(INF|INFINITY|NAN)$" case insensitively),%
\footnote{Note Java's {\tt Double.valueOf} is particular about capitalisation, so additional code is needed to parse all VCF infinite/NaN values.}
Flag, Character, and String.
For the Integer type, the values from $-2^{31}$ to $-2^{31}+7$ cannot be stored in the binary version and therefore are disallowed in both VCF and BCF, see \ref{BcfTypeEncoding}.

\subsection{Meta-information lines}
Expand Down

0 comments on commit 2e0f38c

Please sign in to comment.