Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floating point differences between native code and byte-code on Intel Mac #4149

Closed
vicuna opened this issue Oct 30, 2006 · 1 comment
Closed

Comments

@vicuna
Copy link

vicuna commented Oct 30, 2006

Original bug ID: 4149
Reporter: schneck
Status: closed (set by @damiendoligez on 2006-11-15T11:19:43Z)
Resolution: won't fix
Priority: normal
Severity: minor
Version: 3.09.2
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #4025

Bug description

We have found that on an Intel Mac, we will get different behavior with some floating point operations in native code and bytecode. Here is a minimal example:

(*
On Intel Mac compiled in native code:
4600877379321698713
4600877379321698714
but in bytecode:
4600877379321698714
4600877379321698714
*)

let print f = print_endline (Int64.to_string (Int64.bits_of_float f))

let main () =
let x = 1. /. 3. in
let y = 1. /. 2. in
print (x /. (x +. y));
let x_plus_y = x +. y in
print (x /. x_plus_y)

let _ = main ()

@vicuna
Copy link
Author

vicuna commented Nov 15, 2006

Comment author: @damiendoligez

See the notes for #4025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant