From d8c285c416427e018ab00c4b54d7c30d598e2bc5 Mon Sep 17 00:00:00 2001 From: rich Date: Wed, 27 Dec 2006 14:00:12 +0000 Subject: [PATCH] Use newSVnv in sv_of_float to stop it truncating the float to an int. --- perl_c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl_c.c b/perl_c.c index 1a6b1ef..0d3beef 100644 --- a/perl_c.c +++ b/perl_c.c @@ -1,6 +1,6 @@ /* Interface to Perl from OCaml. * Copyright (C) 2003 Merjis Ltd. - * $Id: perl_c.c,v 1.23 2005-04-14 13:05:12 rich Exp $ + * $Id: perl_c.c,v 1.24 2006-12-27 14:00:12 rich Exp $ */ #include @@ -117,7 +117,7 @@ CAMLprim value perl4caml_sv_of_float (value fv) { CAMLparam1 (fv); - CAMLreturn (Val_sv (newSViv (Double_val (fv)))); + CAMLreturn (Val_sv (newSVnv (Double_val (fv)))); } CAMLprim value -- 1.8.3.1