From 9e2973717806ee28d592b57069a68a14c6a8c077 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Tue, 4 Jan 2011 20:57:00 +0900 Subject: [PATCH] add sin proc for math --- lib/pure/math.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pure/math.nim b/lib/pure/math.nim index 8e3dd4bdb..a55f4495d 100755 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -159,6 +159,7 @@ when not defined(ECMAScript): ## same as ``sqrt(x*x + y*y)``. proc sinh*(x: float): float {.importc: "sinh", header: "".} + proc sin*(x: float): float {.importc: "sin", header: "".} proc tan*(x: float): float {.importc: "tan", header: "".} proc tanh*(x: float): float {.importc: "tanh", header: "".} proc pow*(x, y: float): float {.importc: "pow", header: "".} @@ -209,6 +210,7 @@ else: proc cosh*(x: float): float = return (exp(x)+exp(-x))*0.5 proc hypot*(x, y: float): float = return sqrt(x*x + y*y) proc sinh*(x: float): float = return (exp(x)-exp(-x))*0.5 + proc sin*(x: float): float {.importc: "Math.sin", nodecl.} proc tan*(x: float): float {.importc: "Math.tan", nodecl.} proc tanh*(x: float): float = var y = exp(2.0*x)