[Gambas-devel] Constant Macro Use

Randall Morgan rmorgan62 at ...176...
Tue Jan 31 15:06:49 CET 2012


Hi Benoit,

I have many mathmatical constance that need to be declared in the gsl
class. I figure there are two ways fo doing this, a static property that is
read only or a class constant.
First, I want to make sure constance are usable like this; GSL.M_E /* e
exponent */. If so that is the way I want to go. However, my code below
results in a return value of
zero:

GB_CONSTANT("M_LOG10E", "f", 0.43429448190325182765112891892),   /* log_10
(e) */

So I am wondering if I have miss used the GB_CONSTANT macro?

I have placed it in the Class Desc structure. I also found that I cannot
use the predefined constants in libgsl, as these themselves are macros.

Could you tell me if I should be using a static property set as read only,
or if a GB_CONSTANT is correct?

Thanks,

Randall

-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20120131/dbbdce4c/attachment.html>


More information about the Devel mailing list