You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1590 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Brian Rogoff
Version: 3.06
OS: Solaris
Submission from: 192-149-105-50.artisan.com (192.149.105.50)
let fp_test x =
match x with
0. -> Printf.printf "MATCHED: x = 0\n"
| 90. -> Printf.printf "MATCHED: x = 90\n"
| 180. -> Printf.printf "MATCHED: x = 180\n"
| 270. -> Printf.printf "MATCHED: x = 270\n"
| _ -> Printf.printf "x = %g\n" x;;
Try this with values 0., 90., 180., 270. Results are:
fp_test 0.;;
MATCHED: x = 0
: unit = ()
fp_test 90.;;
x = 90
: unit = ()
fp_test 180.;;
MATCHED: x = 180
: unit = ()
fp_test 270.;;
MATCHED: x = 270
: unit = ()
When I run with -dlambda, I get this code for fp_test
Original bug ID: 1590
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Brian Rogoff
Version: 3.06
OS: Solaris
Submission from: 192-149-105-50.artisan.com (192.149.105.50)
let fp_test x =
match x with
0. -> Printf.printf "MATCHED: x = 0\n"
| 90. -> Printf.printf "MATCHED: x = 90\n"
| 180. -> Printf.printf "MATCHED: x = 180\n"
| 270. -> Printf.printf "MATCHED: x = 270\n"
| _ -> Printf.printf "x = %g\n" x;;
Try this with values 0., 90., 180., 270. Results are:
fp_test 0.;;
MATCHED: x = 0
fp_test 90.;;
x = 90
fp_test 180.;;
MATCHED: x = 180
fp_test 270.;;
MATCHED: x = 270
When I run with -dlambda, I get this code for fp_test
(let
(fp_test/64
(function x/65
(catch
(if (<. x/65 270.)
(if (!=. x/65 0.)
(if (!=. x/65 180.) (exit 1)
(apply (field 1 (global Printf!)) "MATCHED: x = 180\n"))
(apply (field 1 (global Printf!)) "MATCHED: x = 0\n"))
(if (!=. x/65 270.)
(if (!=. x/65 90.) (exit 1)
(apply (field 1 (global Printf!)) "MATCHED: x = 90\n"))
(apply (field 1 (global Printf!)) "MATCHED: x = 270\n")))
with (1) (apply (field 1 (global Printf!)) "x = %g\n" x/65))))
(apply (field 1 (global Toploop!)) "fp_test" fp_test/64))
which will clearly (ahem! ;) never print "MATCHED: x = 90". So this code is
wrong
I think.
-- Brian
The text was updated successfully, but these errors were encountered: