From 2c2baa9fad1d144c42baf30ed004decdf8bb0483 Mon Sep 17 00:00:00 2001 From: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Date: Tue, 5 Jan 2021 20:51:51 +0100 Subject: [PATCH] Link the header (#16597) --- lib/pure/fenv.nim | 6 ++++-- tests/stdlib/tfenv.nim | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/pure/fenv.nim b/lib/pure/fenv.nim index abddaf4cbd..1a895bfa8d 100644 --- a/lib/pure/fenv.nim +++ b/lib/pure/fenv.nim @@ -9,6 +9,8 @@ ## Floating-point environment. Handling of floating-point rounding and ## exceptions (overflow, division by zero, etc.). +## The types, vars and procs are bindings for the C standard library +## [](https://en.cppreference.com/w/c/numeric/fenv) header. when defined(Posix) and not defined(genode): {.passl: "-lm".} @@ -35,8 +37,8 @@ var FE_UPWARD* {.importc, header: "".}: cint ## round toward +Inf FE_DFL_ENV* {.importc, header: "".}: cint - ## macro of type pointer to fenv_t to be used as the argument - ## to functions taking an argument of type fenv_t; in this + ## macro of type pointer to `fenv_t` to be used as the argument + ## to functions taking an argument of type `fenv_t`; in this ## case the default environment will be used type diff --git a/tests/stdlib/tfenv.nim b/tests/stdlib/tfenv.nim index f58acf1c8d..5bcd1ea7c0 100644 --- a/tests/stdlib/tfenv.nim +++ b/tests/stdlib/tfenv.nim @@ -1,8 +1,7 @@ -import fenv +import std/fenv func is_significant(x: float): bool = - if x > minimumPositiveValue(float) and x < maximumPositiveValue(float): true - else: false + x > minimumPositiveValue(float) and x < maximumPositiveValue(float) doAssert is_significant(10.0)