From 47d00eb397231a72c246b1c97cd7c1048be6bee9 Mon Sep 17 00:00:00 2001 From: skilchen Date: Wed, 20 Dec 2017 22:26:22 +0100 Subject: [PATCH] add missing math.trunc for js backend (#6950) --- lib/pure/math.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pure/math.nim b/lib/pure/math.nim index 7fd8bbcef..a9dabfa48 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -291,6 +291,8 @@ when not defined(JS): ## echo fmod(-2.5, 0.3) ## -0.1 else: + proc trunc*(x: float32): float32 {.importc: "Math.trunc", nodecl.} + proc trunc*(x: float64): float64 {.importc: "Math.trunc", nodecl.} proc floor*(x: float32): float32 {.importc: "Math.floor", nodecl.} proc floor*(x: float64): float64 {.importc: "Math.floor", nodecl.} proc ceil*(x: float32): float32 {.importc: "Math.ceil", nodecl.}