nixos/doc/option-types: add precision loss warning for floats

This commit is contained in:
Naïm Favier 2022-09-09 15:39:35 +02:00
parent 5480f45f63
commit 52bbbaeb09
No known key found for this signature in database
GPG Key ID: 95AFCE8211908325
2 changed files with 14 additions and 0 deletions

View File

@ -140,6 +140,11 @@ merging is handled.
: A floating point number.
::: {.warning}
Converting a floating point number to a string with `toString` or `toJSON`
may result in [precision loss](https://github.com/NixOS/nix/issues/5733).
:::
`types.number`
: Either a signed integer or a floating point number. No implicit conversion

View File

@ -256,6 +256,15 @@
<para>
A floating point number.
</para>
<warning>
<para>
Converting a floating point number to a string with
<literal>toString</literal> or <literal>toJSON</literal>
may result in
<link xlink:href="https://github.com/NixOS/nix/issues/5733">precision
loss</link>.
</para>
</warning>
</listitem>
</varlistentry>
<varlistentry>