LazyPIC 0 Posted May 24, 2008 Report Share Posted May 24, 2008 I need to use floating point maths with BoostBasic, but I get silly errors with the most trivial program. Using the Extern function, the following line generates an error and fails to compile:- Extern Function float32_add(x1 as float,x2 as float) as float The compiler lists two errors:- Missing right paren(thesis) Missing data type I cannot see a missing right parenthesis and I have tried various permutations with no success. I have added "float.pic18.lib" to the project (I am using a PIC18F452) Does anyone have any ideas? Quote Link to post Share on other sites
Reynard 0 Posted May 25, 2008 Report Share Posted May 25, 2008 Could it be that BoostBasic does not support the float data type ? The float libraries seem to be only for C and C++ according to the reference manual. Cheers Reynard Quote Link to post Share on other sites
Pavel 0 Posted May 25, 2008 Report Share Posted May 25, 2008 Could it be that BoostBasic does not support the float data type ? Yes this is the exact reason. BoostBasic does not recognise 'float' data type. We have already fixed this problem and after this fix were able to use BoostC floating point library with BoostBasic. This fix will be available in the next release (or update) Regards, Pavel Quote Link to post Share on other sites
LazyPIC 0 Posted May 27, 2008 Author Report Share Posted May 27, 2008 Could it be that BoostBasic does not support the float data type ? Yes this is the exact reason. BoostBasic does not recognise 'float' data type. We have already fixed this problem and after this fix were able to use BoostC floating point library with BoostBasic. This fix will be available in the next release (or update) Regards, Pavel Following help from Pavel, I can get the maths functions to work, but some of the comparison functions fail, namely: ge, gt, ge_quiet and gt_quiet. For example, using "Extern Function float32_ge(a as float, b as float) as boolean", together with "result = call float32_ge(x1,x3)", where result, x1 and x3 are float type, results in a first build pass success, then 11 lines repeating "error: unresolved external function: 'float32_ge(float,float)' " followed by an exit code of -2. Unfortunately the "ge" and "gt" functions are needed for the program which I am developing. regards, Don Quote Link to post Share on other sites
Pavel 0 Posted May 27, 2008 Report Share Posted May 27, 2008 ...Following help from Pavel, I can get the maths functions to work, but some of the comparison functions fail, namely: ge, gt, ge_quiet and gt_quiet.For example, using "Extern Function float32_ge(a as float, b as float) as boolean", together with "result = call float32_ge(x1,x3)", where result, x1 and x3 are float type, results in a first build pass success, then 11 lines repeating "error: unresolved external function: 'float32_ge(float,float)' " followed by an exit code of -2... There are no such functions as float32_gt or float32_ge in the library. If you look into float.h file you'll find that these two are defines based on float32_lt and float32_le functions. Use these two instead. Regards, Pavel Quote Link to post Share on other sites
Pavel 0 Posted August 4, 2008 Report Share Posted August 4, 2008 The new release 6.89 now supports float data type in BoostBasic and includes a sample project that shows how to use float math in basic. Regards, Pavel Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.