how to compare 2 numeric values inside a macro

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to compare 2 numeric values inside a macro

patrick
hello, is there any way to compare 2 numeric values inside a macro, the numeric values should be the parameters, for example something like this:

define compare
  $(if ($(1)>$(2)),yes,no)
endef
Reply | Threaded
Open this post in threaded view
|

Re: how to compare 2 numeric values inside a macro

Mason-32
On 04/06/2014 21:20, patrick wrote:

> Is there any way to compare 2 numeric values inside a macro, the
> numeric values should be the parameters, for example something like this:
>
> define compare
>   $(if ($(1)>$(2)),yes,no)
> endef

Have you seen the answers to your previous questions?
(Some may even apply to your future questions.)

I don't think make supports arithmetic natively.

You could use the shell. You could also use the GMSL.

http://gmsl.sourceforge.net/

--
Regards.

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make