[retroforth] Re: definition of */

  • From: Charles Childers <crc@xxxxxxxxxxxxxx>
  • To: retroforth@xxxxxxxxxxxxx
  • Date: Thu, 28 Oct 2004 06:32:27 -0400

>It's currently
>
>: */ >r * r> / ;   
>
>? Should not calculate this with double precition? Eg. something like
>
>xchg eax,[esi + 4]
>cdq
>mul [esi]
>div [esi+4]
>add esi, 8
>
>? I ask because I currently write on a program that could benefit from the 
>higher precition.
>  
>
As always, there's a balancing act. In RetroForth, I choose to error on 
the side of simplicity (math is limited to 32-bit signed integers), with 
the knowledge that some potential drawbacks (lower precision) come as a 
result.

I do want to explore more complex math functionality with TetraForth 
though and double precision is high on the list. Also unsigned math and 
fixed point math. All of that will take me quite a while to implement 
though.

For those who need this in RetroForth, here's the definition for you:

: */ [ $044687 3, $99 1, $26f7 2, $0476f7 3, $08c683 3, ] ;

--
Charles

Other related posts: