From 419d914ec44e5355d7f9446c98730ee0454acb26 Mon Sep 17 00:00:00 2001 From: burkphil Date: Tue, 13 Aug 2013 15:41:07 +0000 Subject: [PATCH] Fix floating point conversion and printing. D>F and F>D were broken for 64-bit versions of Forth. A fix was proposed by Denis Bernard. Thanks Denis. --- csrc/pfinnrfp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csrc/pfinnrfp.h b/csrc/pfinnrfp.h index 0428b25..e6c0104 100644 --- a/csrc/pfinnrfp.h +++ b/csrc/pfinnrfp.h @@ -22,8 +22,8 @@ ***************************************************************/ #ifdef PF_SUPPORT_FP - -#define FP_DHI1 (((PF_FLOAT)0x40000000)*4.0) + +#define FP_DHI1 (((PF_FLOAT)(1L<<(sizeof(cell_t)*8-2)))*4.0) case ID_FP_D_TO_F: /* ( dlo dhi -- ) ( F: -- r ) */ PUSH_FP_TOS; -- 2.20.1