programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: floating point

From: Charles Melice <3d_at_forthcad.com>
Date: Thu, 20 Apr 2006 10:44:42 +0200

----- Original Message -----
From: "Dr. Roger Dube" <rogerdube_at_dathq.com>
To: <sftalk_at_forth.com>
Sent: Thursday, April 20, 2006 5:20 AM
Subject: [sftalk] floating point

> Content-Type: text/plain;
> charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> As part of a large program, we include fpmath.f since we need floating
> point
> math. We use FVariable to declare space for a floating point variable,
> and
> then f! and f@ to write to and retrieve from that fvariable. For
> checking,
> we can use f. or f>s . to see what is there. Fdepth before and after
> running basic words reveal nothing left behind.
>
>
>
> The first time we write to the variable, all works fine. The SECOND
> time,
> it fails.
>

Don't you forget to initialize the FPSTACK at the beginning
of any message loop ?

    :NONAME ( -- res ) \ GlWindowProc
        [DEFINED] NUMERICS [IF] #NS FSTACK [THEN]
        MSG SwitchMsgLoop ; 4 CB: GlWindowProc

Do you use the software stack (it's more easy) ?

>
>
> Is there something we need to declare to set aside space? How do we
> use it,
> and how much space should be used for typical FP math functions?

    [#NS is the number of floating point items in the stack.]
    [32 CONSTANT #NS]

>
>
>
> What is the difference between "32 FSTACK" and /NDP? Should both be
> used, or
> one, and what is the reason for a specific choice?

    [FSTACK allocates n elements to the numeric stack for the current
task.
    The stack is also initialized to empty.]

    [/NDP initializes the NDP. It sets the Control Register to the
    value saved in the floating point options registry settings.]

>
>
>
> Is there a debug tool that someone could suggest to help us through
> this?
>

Perhaps have a look at FPDEBUG.

Hoping to help you,
Charles

>
>
> Thanks!
>
>
>
> -- Roger
> --------------------------------------------
> Dr. Roger Dube
> President and Chief Science Officer
> Digital Authentication Technologies, Inc.
> 561.392.7404 (office)
> 561.892.2474 (eFax)
> RogerDube_at_datHQ.com
>
> http://www.datHQ.com
>
> 1900 Glades Road Suite 441
> Boca Raton, FL 33431
>
> ----------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s)
> and may
> contain confidential and privileged information. Any unauthorized
> review,
> use, disclosure or distribution is prohibited. If you are not the
> intended
> recipient, please contact the sender by reply email and destroy all
> copies
> of the original message. Any views expressed in this message are those
> of
> the individual sender, except where the sender specifically states
> them to
> be the views of Digital Authentication Technologies, Inc.
>
>
>
>
>
>
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and
> bug
> reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>
>

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Thu Apr 20 2006 - 01:45:58 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:21 PST