[ I put this into “Getting Started” because there isn’t a category for UI commands. ]
I may be missing something not so obvious in the documentation. Is there a UI command (or mix of UI and shell, perhaps) that I can use to force a computed alias quantity into an integer?
I’m computing a cut-off parameter from a quartic “fit” as follows:
# Use quartic fit to max-steps to set upper limit (Horner's rule)
/control/alias C0 1000
/control/alias C1 6
/control/alias C2 0.025
/control/alias C3 -5e-5
/control/alias C4 4e-7
/control/multiply KSTEP {C4} {VOLT} # V*c4
/control/add KSTEP {C3} {KSTEP} # c3 + V*c4
/control/multiply KSTEP {KSTEP} {VOLT} # V*(c3 + V*c4)
/control/add KSTEP {C2} {KSTEP} # c2 + V*(c3 + V*c4)
/control/multiply KSTEP {KSTEP} {VOLT} # V*(c2 + V*(c3 + V*c4))
/control/add KSTEP {C1} {KSTEP} # c1 + V*(c2 + V*(c3 +V*c4))
/control/multiply KSTEP {KSTEP} {VOLT} # V*(c1 + V*(c2 + V*(c3 +V*c4)))
/control/add KSTEP {C0} {KSTEP} # c0 + V*(c1 + V*(c2 + V*(c3 +V*c4)))
where {VOLT} is a set argument from elsewhere. The resulting {KSTEP} is passed to a macro command which expects an integer value. This causes some of my jobs to fail with very sensible errors:
1062.45000: integer expected.
***** Illegal parameter (0) </g4cmp/maximumSteps {KSTEP}000> *****
***** Batch is interrupted!! *****
Multiplying by 1000 (instead of suffixing zeroes) won’t work in general, because for some other voltages, or different coefficients, I may end up not having just two or three decimal places.
So I’m looking for something along the lines of a /control/round or /control/integercommand that would do the job. Any suggestions?