> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sifr.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# SIFR-DECIMAL-0005: Decimal float construction or conversion is forbidden.

> Decimal float construction or conversion is forbidden.

`SIFR-DECIMAL-0005` belongs to the **Decimal arithmetic** diagnostic family. It means: decimal float construction or conversion is forbidden.

## Why It Happens

Sifr keeps decimal values exact. This diagnostic fires when decimal construction, scale handling, or mixed numeric operations would introduce ambiguity or precision loss.

<Info>
  Use `sifr --explain SIFR-DECIMAL-0005` locally to see the renderer's exact message template and any machine-applicable suggestions for the compiler version you are running.
</Info>

## Erroneous Code

```python theme={null}
amount = Decimal("1.25")
```

## How To Fix It

Keep exact decimal values out of binary floating point. Use exact literals or string construction, and do not mix Decimal and BigDecimal in one expression.

## Fixed Code

```python theme={null}
amount = Decimal("1.25")
```

## Details

| Field                  | Value                                                       |
| ---------------------- | ----------------------------------------------------------- |
| Code                   | `SIFR-DECIMAL-0005`                                         |
| Family                 | `DECIMAL`                                                   |
| Severity               | Error                                                       |
| Stability              | stable                                                      |
| Owner                  | `sifr_lowering::lower`                                      |
| Representative fixture | `crates/sifr/tests/e2e/fail/decimal_constructor_float.sifr` |

See the [Error Codes index](/diagnostics/error-codes) for the complete catalog.
