Merge pull request #317 from Gautampd73/master

Added SignumFunction generator
This commit is contained in:
Luke Weiler
2020-10-26 13:09:35 -04:00
committed by GitHub
2 changed files with 20 additions and 0 deletions

View File

@@ -111,3 +111,4 @@ from .decimal_to_bcd import *
from .circumference import *
from .combine_like_terms import *
from .conditional_probability import *
from .signum_function import *

View File

@@ -0,0 +1,19 @@
from .__init__ import *
import random
def signumFunc(min=-999, max=999):
a = random.randint(min, max)
b = 0
if (a > 0):
b = 1
if (a < 0):
b = -1
problem = "signum of " + str(a) + " is " + "="
solution = str(b)
return problem, solution
signum_function = Generator("signum function", 106,
"signum function of a is", "b",
signumFunc)