Re: Switch function from runtime to compile time

2019-03-14 Thread Michelle Long via Digitalmars-d-learn
On Thursday, 14 March 2019 at 11:38:44 UTC, alex1974 wrote: I have several geometric shapes (triangle, trapezoid, gauss, ...) forming the membership functions of a fuzzy set. For example the shape of the triangle is defined by the variables a, b and c. The function calculating membership looks

Re: Switch function from runtime to compile time

2019-03-14 Thread Alex via Digitalmars-d-learn
On Thursday, 14 March 2019 at 11:38:44 UTC, alex1974 wrote: I have several geometric shapes (triangle, trapezoid, gauss, ...) forming the membership functions of a fuzzy set. For example the shape of the triangle is defined by the variables a, b and c. The function calculating membership looks

Switch function from runtime to compile time

2019-03-14 Thread alex1974 via Digitalmars-d-learn
I have several geometric shapes (triangle, trapezoid, gauss, ...) forming the membership functions of a fuzzy set. For example the shape of the triangle is defined by the variables a, b and c. The function calculating membership looks like: real triangle (real a, real b, real c, real value) {