From 5163fe7d878f48870c6d0235d70d45e1e414dca8 Mon Sep 17 00:00:00 2001 From: Miran Date: Tue, 25 Aug 2020 15:59:42 +0200 Subject: [PATCH] remove deprecation from `math.round` (#15224) --- changelog.md | 7 +++++++ lib/pure/math.nim | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index eebccb62f1..3865f1efbc 100644 --- a/changelog.md +++ b/changelog.md @@ -164,7 +164,14 @@ echo foo ``` +- Proc `math.round` is no longer deprecated. The advice to use `strformat` instead + cannot be applied to every use case. The limitations and the (lack of) reliability + of `round` are well documented. + + + ## Language changes + - The `=destroy` hook no longer has to reset its target, as the compiler now automatically inserts `wasMoved` calls where needed. - In the newruntime it is now allowed to assign to the discriminator field diff --git a/lib/pure/math.nim b/lib/pure/math.nim index c02bef2f79..21d614270a 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -768,8 +768,7 @@ else: # JS ## ( 6.5 mod -2.5) == 1.5 ## (-6.5 mod -2.5) == -1.5 -proc round*[T: float32|float64](x: T, places: int): T {. - deprecated: "use strformat module instead".} = +proc round*[T: float32|float64](x: T, places: int): T = ## Decimal rounding on a binary floating point number. ## ## This function is NOT reliable. Floating point numbers cannot hold