caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Passing a double from C to ocaml
@ 2003-07-21 18:32 Jung Woon Ho
  2003-07-21 20:26 ` Kip Macy
  2003-07-21 20:27 ` Karl Zilles
  0 siblings, 2 replies; 3+ messages in thread
From: Jung Woon Ho @ 2003-07-21 18:32 UTC (permalink / raw)
  To: caml-list


Is there any way.. that I can pass a double from C to ocaml without loosing 
precision?
What is the data type that is equivalent to double in Ocaml.

I'm trying to get a double from a C-function and convert it to "Num" in 
Ocaml.

Thank you.

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Passing a double from C to ocaml
  2003-07-21 18:32 [Caml-list] Passing a double from C to ocaml Jung Woon Ho
@ 2003-07-21 20:26 ` Kip Macy
  2003-07-21 20:27 ` Karl Zilles
  1 sibling, 0 replies; 3+ messages in thread
From: Kip Macy @ 2003-07-21 20:26 UTC (permalink / raw)
  To: Jung Woon Ho; +Cc: caml-list

Ocaml "float" == C "double"



On Mon, 21 Jul 2003, Jung Woon Ho wrote:

> 
> Is there any way.. that I can pass a double from C to ocaml without loosing 
> precision?
> What is the data type that is equivalent to double in Ocaml.
> 
> I'm trying to get a double from a C-function and convert it to "Num" in 
> Ocaml.
> 
> Thank you.
> 
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> 

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Passing a double from C to ocaml
  2003-07-21 18:32 [Caml-list] Passing a double from C to ocaml Jung Woon Ho
  2003-07-21 20:26 ` Kip Macy
@ 2003-07-21 20:27 ` Karl Zilles
  1 sibling, 0 replies; 3+ messages in thread
From: Karl Zilles @ 2003-07-21 20:27 UTC (permalink / raw)
  To: Jung Woon Ho; +Cc: caml-list

Jung Woon Ho wrote:

> 
> Is there any way.. that I can pass a double from C to ocaml without 
> loosing precision?
> What is the data type that is equivalent to double in Ocaml.
> 
> I'm trying to get a double from a C-function and convert it to "Num" in 
> Ocaml.
> 
> Thank you.
> 

The OCaml "float" value is actually double precision.  From the manual:

Floating-point numbers

Floating-point values are numbers in floating-point representation. The 
current implementation uses double-precision floating-point numbers 
conforming to the IEEE 754 standard, with 53 bits of mantissa and an 
exponent ranging from -1022 to 1023.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-21 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-21 18:32 [Caml-list] Passing a double from C to ocaml Jung Woon Ho
2003-07-21 20:26 ` Kip Macy
2003-07-21 20:27 ` Karl Zilles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).