Skip to content

Commit

Permalink
Merge pull request #4297 from soerenwolfers/patch-65
Browse files Browse the repository at this point in the history
Update numeric.md
  • Loading branch information
szarnyasg authored Dec 7, 2024
2 parents ffce47e + fb03d0e commit bafcfd1
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions docs/sql/data_types/numeric.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,25 @@ In addition to ordinary numeric values, the floating-point types have several sp
* `-Infinity`: negative infinity
* `NaN`: not a number

> On a machine whose floating-point arithmetic does not follow IEEE 754, these values will probably not work as expected.
On machines with the required CPU/FPU support, DuckDB follows the IEEE 754 specification regarding these special values, with two exceptions:

When writing these values as constants in a SQL command, you must put quotes around them, for example:
* `NaN` compares equal to `NaN` and greater than any other floating point number.
* Some floating point functions, like `sqrt` / `sin` / `asin` throw errors rather than return `NaN` for values outside their ranges of definition.

To insert these values as literals in a SQL command, you must put quotes around them, you may abbreviate `Infinity` as `Inf`, and you may use any capitalization. For example:

```sql
UPDATE table
SET x = '-Infinity';
SELECT
sqrt(2) > '-inf',
'nan' > sqrt(2)
```

On input, these strings are recognized in a case-insensitive manner.
<div class="narrow_table monospace_table"></div>

| (sqrt(2) > '-inf') | ('nan' > sqrt(2)) |
|-------------------:|------------------:|
| true | true |


## Universally Unique Identifiers (`UUID`s)

Expand Down

0 comments on commit bafcfd1

Please sign in to comment.