Right now, both commands and intermediate results are encoded using the default R numeric type (C double). Using int instead appears to reduce the computing cost of the core layer logic code by about 15%. The cost is that any arithmetic done on the layer logic formulas can only involve integers and will resolve as C integer arithmetic. I am not aware of any applications in which floating point arithmetic might be useful, but if we ever implement a valued version of layer logic, it would be needed.
Right now, both commands and intermediate results are encoded using the default R
numeric
type (Cdouble
). Usingint
instead appears to reduce the computing cost of the core layer logic code by about 15%. The cost is that any arithmetic done on the layer logic formulas can only involve integers and will resolve as C integer arithmetic. I am not aware of any applications in which floating point arithmetic might be useful, but if we ever implement a valued version of layer logic, it would be needed.