From 1cc2e9abe76fb093ceda9b1f5b60ae3a95b4642f Mon Sep 17 00:00:00 2001 From: sam-astro <77079540+sam-astro@users.noreply.github.com> Date: Wed, 5 Jan 2022 08:41:25 -0500 Subject: [PATCH] Updated to new function syntax --- Slang/builtin.slg | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Slang/builtin.slg b/Slang/builtin.slg index ef57819..76b3943 100644 --- a/Slang/builtin.slg +++ b/Slang/builtin.slg @@ -4,7 +4,7 @@ float PI = 3.14159265358979 float EulersNumber = 2.71828183 // Trigonometric function Sin -float Sin(float input) +func Sin(input) { print input float out = CPP.Math.Sin(input) @@ -12,42 +12,42 @@ float Sin(float input) } // Trigonometric function Cos -float Cos(float input) +func Cos(input) { float out = CPP.Math.Cos(input) return out } // Trigonometric function Tan -float Tan(float input) +func Tan(input) { float out = CPP.Math.Tan(input) return out } // Sigmoid activation function -float Sigmoid(float input) +func Sigmoid(input) { float out = 1 / (1+EulersNumber^-input) return out } // Hyperbolic tangent activation function -float Tanh(float input) +func Tanh(input) { float out = ((EulersNumber^input)-(EulersNumber^-input))/((EulersNumber^input)+(EulersNumber^-input)) return out } // Rounds input to nearest integer value -float Round(float input) +func Round(input) { float out = CPP.Math.Round(input) return out } // Clamps input between min and max -float Clamp(float input, float min, float max) +func Clamp(input, min, max) { if input < min { @@ -61,21 +61,21 @@ float Clamp(float input, float min, float max) } // Sets color of pixel to RGB value -float SetPixel(int x, int y, int r, int g, int b) +func SetPixel(x, y, r, g, b) { string out = CPP.Graphics.SetPixel(x, y, r, g, b) return out } // Prints input value to console -float Print(string in) +func Print(in) { string out = CPP.System.Print(in) return out } // Prints input value to console with appended newline '\n' -float Printl(string in) +func Printl(in) { string out = CPP.System.PrintLine(in) return out