Page 1 of 1

Floating point Info V3

Posted: Thu Sep 17, 2009 8:17 pm
by MarkW
Hi

I have followed the example on using floating point maths with V3
and with a bit of fiddling on my own got my program to run ok.
However I cannot seem to find any reference to the functions
that describes the operation thereof, or a list of the functions
available! I have looked at boostC manual etc and there is no
information about these functions. One particular function
that i need clarification on is:
FCV_VAR = float32_to_int32_round_to_zero(varx)
Does the round to zero simply discard the real part and return the whole part
of the calculation or does it actually round off the real part and increase or
leave alone the whole part of the answer? (this may have an effect on accuracy
of my calcs).

Also what is the most recent update on Flowcode V3? I have seen reference to a version
3.6xx somewhere here on the forums.....

Ben, Steve / anyone know?

Mark

Re: Floating point Info V3

Posted: Fri Sep 18, 2009 8:13 am
by Benj
Hello Mark

You can find the latest download versions of Flowcode by visiting the main Flowcode product page on our website.

The float32_to_int32_round_to_zero function rounds to an integer number but will always round down if it is a positive number and round up if it is a negative.

You can find the list of Floating point functions in the Flowcode V3/BoostC/Includes/Float.h file though it is not very well commented.

Re: Floating point Info V3

Posted: Fri Sep 18, 2009 9:45 am
by MarkW
Thanx Ben

Yes, did look at the header file before and as you say its not very well documented.
But i will try to extract the info i need for the functions.

So, according to your statement about the round to zero function I assume I
am correct that if my var is always positive (always round down), then the answer will
simply be always the real part discarded? eg. var = 1234.xxxx will be var=1234.0000?

thanx for your input!

Mark

Re: Floating point Info V3

Posted: Fri Sep 18, 2009 2:33 pm
by Benj
Hi Mark

Yes thats correct about the floating point function. Let me know if you get stuck.