Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Mathematical routines Message-ID: <2451.UUL1.3#5129@willett.pgh.pa.us> Date: 4 Mar 91 13:19:56 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 47 Date: 02-26-91 (11:21) Number: 1341 of 1349 (Echo) To: CROSBY STONE Refer#: NONE From: RAY DUNCAN Read: NO Subj: NUMBER? ETC. Status: PUBLIC MESSAGE Conf: FORTH (58) Read Type: GENERAL (+) Sorry about not getting back to you sooner. I didn't find your file NUMBER.TXT until a couple of days ago. Nobody stuffs the vectors for NUMBER? /NUMBER and NUMBER, *except* for the various floating point overlays during their installation (the BIN file is read into memory, relocated, and then the "top" word in the overlay is executed which pokes the vectors so that the Forth interpreter/compiler will know how to interpret or compile floating point numbers). If you load the SFP or I8087 overlay and *then* poke the vectors for NUMBER, /NUMBER and NUMBER? to point to your "own" versions of these words, the vectors will stay stable throughout the execution of your application. NUMBER? is the generalized ASCII-to-binary numeric conversion operation. It accepts the address of a counted string and returns a binary value and a flag (which indicates whether the string was a valid number or not, and if so which type of number) on the stack. NUMBER? is always called by the Forth interpreter/compiler regardless of STATE. NUMBER, is called by the Forth interpreter/compiler *after* NUMBER? if STATE is nonzero (i.e. the system is "compiling"). NUMBER, looks at the flag left by NUMBER? and decides how to compile the binary value beneath the flag as a literal. /NUMBER is called by the Forth interpreter/compiler *after* NUMBER? if STATE is zero (i.e. the system is "interpreting"). /NUMBER looks at the flag left by NUMBER? and discards the flag and any other debris, leaving only a single, double, or floating point value on the stack. Accordingly, the three words NUMBER? NUMBER, /NUMBER are a matched set and must all be replaced together (by poking the vectors for these three words) or not at all. NET/Mail : LMI Forth Board, Los Angeles, CA (213) 306-3530 <<<>>> ----- This message came from GEnie via willett. You *cannot* reply to the author using e-mail. Please post a follow-up article, or use any instructions the author may have included (USMail addresses, telephone #, etc.). Report problems to: dwp@willett.pgh.pa.us _or_ uunet!willett!dwp