Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanThoma committed Oct 10, 2023
1 parent 1e09057 commit bc8f2b9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions posts/2023-10-30_floating_point/floating_point.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,27 @@ options(fpCompare.tolerance = 1e-8)


As long as {{admiral}} remains open source and free to use, using this package, or even reusing the code itself would be fine.
Although this was *my* prefered option, we did not end up implementing it.
Instead, we made use of the `signif()` function, which rounds a number to a specified number of significant digits.
This way, we could use the regular infix operators and simply provide the number of significant digits we want to compare to:

```{r}
signif_dig <- 15
AVAL <- 110
signif(AVAL, signif_dig) == signif(ANRHI*1.1, signif_dig)
# as:
(ANRHI*1.1) %>% signif(signif_dig) %>% format(digits = 22)
```


```{r}
atoxgr_criteria_ctcv5
```


atoxgr_criteria_ctcv5

## Solution in {{admiral}}

Expand Down

0 comments on commit bc8f2b9

Please sign in to comment.