jeudi 19 décembre 2019

Unexpected behavior of if statement in OCaml

I am learning OCaml so maybe I am writing this if-statement wrong, but for this statement:

# if 0.3 -. 0.2 = 0.1 then ’a’ else ’b’;;

the output is:

- : char = 'b'

Shouldn't the output be 'a', since 0.3 - 0.2 = 0.1? The behavior is also the same when I write == instead of =.

Aucun commentaire:

Enregistrer un commentaire