float.c (94290) | float.c (167850) |
---|---|
1/******************************************************************* 2** f l o a t . c 3** Forth Inspired Command Language 4** ANS Forth FLOAT word-set written in C 5** Author: Guy Carver & John Sadler (john_sadler@alum.mit.edu) 6** Created: Apr 2001 7** $Id: float.c,v 1.8 2001/12/05 07:21:34 jsadler Exp $ 8*******************************************************************/ --- 27 unchanged lines hidden (view full) --- 36** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 39** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 40** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 41** SUCH DAMAGE. 42*/ 43 | 1/******************************************************************* 2** f l o a t . c 3** Forth Inspired Command Language 4** ANS Forth FLOAT word-set written in C 5** Author: Guy Carver & John Sadler (john_sadler@alum.mit.edu) 6** Created: Apr 2001 7** $Id: float.c,v 1.8 2001/12/05 07:21:34 jsadler Exp $ 8*******************************************************************/ --- 27 unchanged lines hidden (view full) --- 36** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 39** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 40** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 41** SUCH DAMAGE. 42*/ 43 |
44/* $FreeBSD: head/sys/boot/ficl/float.c 94290 2002-04-09 17:45:28Z dcs $ */ | 44/* $FreeBSD: head/sys/boot/ficl/float.c 167850 2007-03-23 22:26:01Z jkim $ */ |
45 46#include <stdlib.h> 47#include <stdio.h> 48#include <string.h> 49#include <ctype.h> 50#include <math.h> 51#include "ficl.h" 52 --- 919 unchanged lines hidden (view full) --- 972 exponent = -exponent; 973 } 974 /* power = 10^x */ 975 power = (float)pow(10.0, exponent); 976 accum *= power; 977 } 978 979 PUSHFLOAT(accum); | 45 46#include <stdlib.h> 47#include <stdio.h> 48#include <string.h> 49#include <ctype.h> 50#include <math.h> 51#include "ficl.h" 52 --- 919 unchanged lines hidden (view full) --- 972 exponent = -exponent; 973 } 974 /* power = 10^x */ 975 power = (float)pow(10.0, exponent); 976 accum *= power; 977 } 978 979 PUSHFLOAT(accum); |
980 if (pVM->state == COMPILE) 981 fliteralIm(pVM); |
|
980 981 return(1); 982} 983 984#endif /* FICL_WANT_FLOAT */ 985 986/************************************************************************** 987** Add float words to a system's dictionary. --- 69 unchanged lines hidden (view full) --- 1057 dictAppendWord(dp, "(fliteral)", fliteralParen, FW_COMPILE); 1058 1059 ficlSetEnv(pSys, "floating", FICL_FALSE); /* not all required words are present */ 1060 ficlSetEnv(pSys, "floating-ext", FICL_FALSE); 1061 ficlSetEnv(pSys, "floating-stack", FICL_DEFAULT_STACK); 1062#endif 1063 return; 1064} | 982 983 return(1); 984} 985 986#endif /* FICL_WANT_FLOAT */ 987 988/************************************************************************** 989** Add float words to a system's dictionary. --- 69 unchanged lines hidden (view full) --- 1059 dictAppendWord(dp, "(fliteral)", fliteralParen, FW_COMPILE); 1060 1061 ficlSetEnv(pSys, "floating", FICL_FALSE); /* not all required words are present */ 1062 ficlSetEnv(pSys, "floating-ext", FICL_FALSE); 1063 ficlSetEnv(pSys, "floating-stack", FICL_DEFAULT_STACK); 1064#endif 1065 return; 1066} |
1067 |
|