Skip to content

Commit 8059035

Browse files
authored
Update mathematical-precision.md
1 parent e2b9292 commit 8059035

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/recipes/mathematical-precision.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,23 @@
1818

1919
# Mathematical Precision
2020

21-
So far, Lucee has handled numbers internally as “double”, but with Lucee 6 we have switched to “BigDecimal”. This makes math operations much more precise and there is no need anymore to use the function “PrecisionEvaluate”.
21+
So far, Lucee has handled numbers internally as “double”, but with Lucee 6 we have added support for using “BigDecimal”.
2222

23-
Since version 6.0, all numbers Lucee uses in the runtime are by default BigDecimal based and no longer double as before. You can still change that fact in the Application.cfc as follows:
23+
This makes math operations much more precise (but slower) and there is no need anymore to use the function “PrecisionEvaluate”.
24+
25+
Since version 6.0, all numbers Lucee uses in the runtime are by default BigDecimal based and no longer double as before.
26+
27+
However, for performance reasons, with Lucee 6.2, we reverted the default to the old behaviour as it's much faster.
28+
29+
You can toggle precise math in the `Application.cfc` as follows:
2430

2531
```lucee
26-
this.preciseMath = false;
32+
this.preciseMath = true | false;
2733
```
2834

2935
## Dynamically during a request
3036

31-
You also simply toggle precision on or off for the current request.
37+
You also simply toggle precision on or off for the current request, only as required, which is recommended for best performance.
3238

3339
```lucee
3440
application action="update" preciseMath="true|false";

0 commit comments

Comments
 (0)