Can you please provide a flowcode example of floating point maths.
With one number that divides into the other.
Looked at the example but don't understand how to use it for simple maths.
Thanks
Wayne M
FLOATING POINT MATHS
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
In the top box of the "supplementary code" window, you need to add the following line:
Also, create an INT variable called "x".
Then, put this C code into a 'C' icon:
At the end of this, your variable "X" will contain the value 124.
The functions available are in the "float.h" file (in the "boostc\include" directory). Here's a summary:
Code: Select all
#include <float.h>
Then, put this C code into a 'C' icon:
Code: Select all
float x = 1238.56;
float y = 10.0;
float z;
z = float32_div(x,y);
FCV_X = float32_to_int32(z);
The functions available are in the "float.h" file (in the "boostc\include" directory). Here's a summary:
Code: Select all
// Software IEC/IEEE integer-to-floating-point conversion routines.
float float32_from_int32( int32 );
//Software IEC/IEEE single-precision conversion routines.
int32 float32_to_int32( float );
int32 float32_to_int32_round_to_zero( float );
// Software IEC/IEEE single-precision operations.
float float32_round_to_int( float );
float float32_add( float, float );
float float32_sub( float, float );
float float32_mul( float, float );
float float32_div( float, float );
float float32_rem( float, float );
float float32_sqrt( float );
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
floating point maths
Sorry still not understand have you got a simple example of a number that is divide by other number.
Sorry
Thanks
Wayne M
Sorry
Thanks
Wayne M
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
floating point maths
Steve,
sorry.
how do i use float32_XXX. do i need to call this in flowcode.
Because i can see this in the example but do not understand how to use it.
do i need to put float32 C code in to the flowcode to call float32.
Wayne M

sorry.
how do i use float32_XXX. do i need to call this in flowcode.
Because i can see this in the example but do not understand how to use it.
do i need to put float32 C code in to the flowcode to call float32.
Wayne M
