MIN/MAX function

More
28 Jun 2013 13:47 #36146 by Nick
MIN/MAX function was created by Nick
Hi! Is there any way to get min or max of two parameters except using if expression?
O100 IF [#1 GT #2]
#<max> = #1
O100 ELSE
#<max> = #2
O100 ENDIF

It'll be great if we would be able to find max inline :).

Please Log in or Create an account to join the conversation.

More
28 Jun 2013 15:27 #36147 by andypugh
Replied by andypugh on topic MIN/MAX function

Hi! Is there any way to get min or max of two parameters except using if expression?

I don't think so. G-code doesn't seem to support any functions that take more than one argument.
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...2038993a733526#l2272
is moderately interesting reading (G-code ATAN is very odd in syntax)

Please Log in or Create an account to join the conversation.

More
28 Jun 2013 16:54 - 28 Jun 2013 16:57 #36150 by Nick
Replied by Nick on topic MIN/MAX function
Yep - atan has a kind of strange syntax :)
I thought that we can use SUB CALL with any amount of parameters up to 30 but it would not be an inline max...


PS GT LT MOD and others do support 2 arguments ;)
Probably it can be done as #<res> = #1 MAX #2
but still it'll have odd syntax :)
Last edit: 28 Jun 2013 16:57 by Nick.

Please Log in or Create an account to join the conversation.

Time to create page: 0.144 seconds
Powered by Kunena Forum