cuadrado::Float->Float cuadrado x = x*x estres::Integer->Bool estres 3=True estres x=False cuadrado_menos_uno::Integer->Integer cuadrado_menos_uno z=z*z-1 maximo::(Integer,Integer)->Integer maximo (x,y)= if x>y then x else y par::Integer->Bool par x = if (mod x 2)==0 then True else False max3::(Float,Float,Float)->Float max3 (x,y,z) = if x>y && x>z then x else if y>z then y else z sgn::Int->Int sgn x = if x>0 then 1 else if x==0 then x else -1 abs::Int->Int abs x = if x>=0 then x else -x bisiesto::Int->Bool bisiesto x = if (mod x 4)==0 && not((mod x 100)==0) then True else if (mod x 100)==0 && (mod x 400)==0 then True else False lados_tri::(Float,Float,Float)->Bool lados_tri (x,y,z)= if x== max3 (x,y,z) && x <(y+z) then True else if y== max3 (x,y,z) && y <(x+z) then True else if z== max3 (x,y,z) && z <(x+y) then True else False es_rect::(Float,Float,Float)->Bool es_rect (x,y,z)= if (cuadrado (max3 (x,y,z)))==(cuadrado x + cuadrado y) || ( cuadrado (max3 (x,y,z))) == (cuadrado y + cuadrado z)|| ( cuadrado (max3 (x,y,z))) == (cuadrado z + cuadrado x) then True else False