Re: [Vala] Patch to include fabs, abs, MAX and MIN
- From: Jürg Billeter <j bitron ch>
- To: Mario Carrión <mario carrion gmail com>
- Cc: vala paldo org
- Subject: Re: [Vala] Patch to include fabs, abs, MAX and MIN
- Date: Fri, 19 Oct 2007 12:59:53 +0200
Hi,
On Sat, 2007-10-13 at 19:56 -0500, Mario Carrión wrote:
The attached patch adds to GLib.Math the following methods:
- max
- min
- fabs
- abs
However, what do you think about using max and min methods with
different signatures, let say:
fmax, fmin: floats
max, min: integers
dmax, dmin: doubles
Attached patch defines the parameters for max and min as doubles.
We should probably add this functionality as static methods to the
appropriate datatypes instead of the Math class.
Sou you'd call for example:
double.min (a, b) instead of Math.dmin (a, b)
Would that be ok for everyone?
We still have the issue that macros don't cope well with side-effects,
so we probably want a special attribute, so that Vala can take care of
temporary copies, if necessary.
BTW: The CLAMP macro is already bound for int and uint.
Jürg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]