Does .math() always return a Double?

I have the following query, how can I get the result as a Long instead of a Double? In context, I want this query to be unioned with a set of other numbers which are Longs and then I want to take the .max() of them. But I can't do that if I have a mix of Long and Double
Long tenHours = Long.valueOf(Duration.ofHours(10).toMillis());

g.withSideEffect("tenHours", tenHours).inject(1689570000000L).math("_ + tenHours").next().getClass()
Long tenHours = Long.valueOf(Duration.ofHours(10).toMillis());

g.withSideEffect("tenHours", tenHours).inject(1689570000000L).math("_ + tenHours").next().getClass()
2 Replies
danielcraig23
danielcraig23OP16mo ago
I need .math() to return a Long I have discovered a workaround, but it's a little bit awkward.
spmallette
spmallette16mo ago
there has been some discussion of adding more type conversion steps as first-class citizens. until then there aren't too many options for changing types in Gremlin. it generally something left for the client-side.
Want results from more Discord servers?
Add your server