all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
let f x = sqrt x +. 5.0 *. (x ** 3.0)
|
||||
let p x = x < 400.0
|
||||
|
||||
let () =
|
||||
print_endline "Please enter 11 Numbers:";
|
||||
let lst = Array.to_list (Array.init 11 (fun _ -> read_float ())) in
|
||||
List.iter (fun x ->
|
||||
let res = f x in
|
||||
if p res
|
||||
then Printf.printf "f(%g) = %g\n%!" x res
|
||||
else Printf.eprintf "f(%g) :: Overflow\n%!" x
|
||||
) (List.rev lst)
|
||||
Loading…
Add table
Add a link
Reference in a new issue