From 6d4edaa609b1ed4132fa63ca00048f683ccd9f85 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 13 Feb 2008 15:20:59 +0000 Subject: [PATCH] allow float matrix to be initialised with ints. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2098 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- library/matrix/matrix.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/matrix/matrix.c b/library/matrix/matrix.c index 6f615733f..9398e2df2 100644 --- a/library/matrix/matrix.c +++ b/library/matrix/matrix.c @@ -264,11 +264,14 @@ cp_float_matrix(YAP_Term tl,YAP_Term matrix) return FALSE; } th = YAP_HeadOfTerm(tl); - if (!YAP_IsFloatTerm(th)) { + if (YAP_IsIntTerm(th)) { + d = YAP_IntOfTerm(th); + } else if (!YAP_IsFloatTerm(th)) { /* ERROR */ return FALSE; + } else { + d = YAP_FloatOfTerm(th); } - d = YAP_FloatOfTerm(th); j[i] = d; tl = YAP_TailOfTerm(tl); }