From 23eddb756d0bc559b5f8fba71903e789bfa0f842 Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Sun, 19 Jan 2025 21:12:50 -0600 Subject: [PATCH] add basic trig functions to floats --- src/Instructions/FloatInstructions.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Instructions/FloatInstructions.hs b/src/Instructions/FloatInstructions.hs index d1fd0b5..caf2589 100644 --- a/src/Instructions/FloatInstructions.hs +++ b/src/Instructions/FloatInstructions.hs @@ -86,3 +86,15 @@ instructionFloatShoveDup state = instructionShoveDup state float instructionFloatShove :: State -> State instructionFloatShove state = instructionShove state float + +instructionFloatSin :: State -> State +instructionFloatSin state@(State {_float = f1 : fs}) = state {_float = sin f1 : fs} +instructionFloatSin state = state + +instructionFloatCos :: State -> State +instructionFloatCos state@(State {_float = f1 : fs}) = state {_float = cos f1 : fs} +instructionFloatCos state = state + +instructionFloatTan :: State -> State +instructionFloatTan state@(State {_float = f1 : fs}) = state {_float = tan f1 : fs} +instructionFloatTan state = state