Hello,
What is the correct way to convert an Int to Float in V4?
I tried a test with this program:
It simulates but it won't compile, giving this error:
Searching the forum didn't clarified this. What went wrong?
Regards,
Eric
Int to Float
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Int to Float
Hello Eric
Using BoostC this is a little awkward.
You can do the following.
Using a C code icon and the flowcode variables fl_var and int_var.
FCV_FL_VAR = float32_to_int32(FCV_INT_VAR);
There are further functions available inside the calculation icon which can be used to do floating point calculations in BoostC. These functions will work inside the calculation icon.
Hope this helps.
Using BoostC this is a little awkward.
You can do the following.
Using a C code icon and the flowcode variables fl_var and int_var.
FCV_FL_VAR = float32_to_int32(FCV_INT_VAR);
There are further functions available inside the calculation icon which can be used to do floating point calculations in BoostC. These functions will work inside the calculation icon.
Hope this helps.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Int to Float
Not really, I still have errors.
Can you please verify or complete this test program so that this program works?
Thx,
Eric
Eric
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Int to Float
Hello Eric
Here is a working version of your program.
Here is a working version of your program.
- Attachments
-
- Test1.fcf
- (5 KiB) Downloaded 352 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Int to Float
Thx Ben, now I see.
But the compiled program is hugh !
7.5K !
Floating point seems to consume a lot of resources.
Rgds,
Eric
But the compiled program is hugh !
7.5K !
Floating point seems to consume a lot of resources.
Rgds,
Eric