[futurebasic] Re: [FB] fixed point vars

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2003 : Group Archive : Group : All Groups

From: "Andrea P." <andrea.pic@...>
Date: Mon, 15 Dec 2003 17:38:08 +0100
 
> I'm not sure why you need this, but you can declare a FB var "AS
> FIXED". FB doesn't manipulate fixed values (i.e., I don't think you
> can use them in calculations), but they can be used for toolbox
> routines that require them. See the manual pp. 646 & 651.

I'Have this graphic function that I Use to draw a DXF object
FOR j& = nRec&+1 TO (nRec&+TotRec&)

'----- Conversion mm to pixel ---------
 rXs = DW.Xstart!(j&) / ScaleComp!
 rYs = DW.Ystart!(j&) / ScaleComp!
 rXe = DW.Xend!(j&)   / ScaleComp!
 rYe = dW.Yend!(j&)   / ScaleComp!
'------ draw object -------------------
.....

NEXT j&

When I have a big object drawing is slow  because  division between two
floating point is very slow.

When I wrote the same function in C++ I've solved this problem using
fixed-point Instead of floating-point.

hy,
andrea