From 8dd26993fc8db11624dceaed7ce8575454fa924a Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 18 Aug 2011 17:10:40 +0000 Subject: [PATCH] Correct packing of floats This commit was SVN r25065. --- opal/dss/dss_pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opal/dss/dss_pack.c b/opal/dss/dss_pack.c index cd02043bfd..873726ecaa 100644 --- a/opal/dss/dss_pack.c +++ b/opal/dss/dss_pack.c @@ -429,7 +429,7 @@ static int opal_dss_pack_float(opal_buffer_t *buffer, float val) if (OPAL_SUCCESS != (ret = opal_dss_pack_buffer(buffer, &tmp1, 1, OPAL_INT32))) { return ret; } - tmp2 = (int)((100.0 * val) - ((int)val)); + tmp2 = (int)(100.0 * (val - (int)val)); if (OPAL_SUCCESS != (ret = opal_dss_pack_buffer(buffer, &tmp2, 1, OPAL_INT32))) { return ret; }