[top][index]
search for:

numeric -- convert to floating point

numeric x -- yields the expression obtained from x by converting the integers and rational numbers within to double precision floating point numbers.

i1 : numeric {1,2,3}

o1 = {1., 2., 3.}

o1 : List

See also RR.

Code:

     -- ../../../Macaulay2/m2/numbers.m2:9-14
     numeric = x -> (
          if basictype x === ZZ or basictype x === QQ
          then 0. + x
          else if basictype x === BasicList or basictype x === Sequence
          then apply(x,numeric)
          else x);

[top][index]
search for: