[Gambas-devel] Constant Macro Use

Randall Morgan rmorgan62 at ...176...
Tue Jan 31 20:28:52 CET 2012


Hi Benoit,

I have quoted the value but then all my constants return garbage values. I
also tried shortening the values to 16 digits still, I get garbage out.

The GB_CONSTANT macro works as expected with strings however.



On Tue, Jan 31, 2012 at 6:06 AM, Randall Morgan <rmorgan62 at ...176...> wrote:

> 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?
>



-- 
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/775dc757/attachment.html>


More information about the Devel mailing list