Arc Forumnew | comments | leaders | submitlogin
1 point by zck 4295 days ago | link | parent

What did you want the type of the result to be?

If you want a string, for output, you can use `num` (http://files.arcfn.com/doc/string.html#num):

    arc> (num (/ 3 2))
    "1.5"
If you want some sort of floating-point, I suppose you could use `nearest`, which was renamed from `to-nearest` a while ago (http://files.arcfn.com/doc/math.html#to-nearest):

    arc> (nearest (/ 3 2) .1)
    1.5
That still returns a number:

    arc> (type (nearest (/ 3 2) .1))
    num
It's kind of ugly, but I don't know of any better way.


1 point by jsgrahamus 4295 days ago | link

Thanks, zck.

So I can use this:

  (coerce (num (/ 3 2)) 'num) --> 1.5

-----