enum HoldSide { SHORT, LONG; static HoldSide fromInt(double direction) { if (direction > 0) ret LONG; if (direction < 0) ret SHORT; fail("direction 0"); } }