George C. Privon 2 anni fa
parent
commit
553906be3f
1 ha cambiato i file con 15 aggiunte e 0 eliminazioni
  1. 15 0
      03-typesandentities/exercises/ex3.2.hs

+ 15 - 0
03-typesandentities/exercises/ex3.2.hs

@@ -0,0 +1,15 @@
+-- Exercise 3.2
+-- George C. Privon
+-- 2023-09-05
+
+-- a)
+f :: Double -> Double
+f x = if x <= 0
+    then 0
+    else x
+
+-- b)
+bigE :: Double -> Double
+bigE r = if r <= 1
+    then r
+    else 1 / r^2