Macaulay2 » Documentation
Packages » ForeignFunctions :: ForeignRealType Number
next | previous | forward | backward | up | index | toc

ForeignRealType Number -- cast a Macaulay2 number to a foreign real object

Synopsis

Description

To cast a Macaulay2 number to a foreign object with a real type, give the type followed by the number.

i1 : float 3

o1 = 3

o1 : ForeignObject of type float
i2 : double pi

o2 = 3.14159265358979

o2 : ForeignObject of type double

The imaginary parts of complex numbers are discarded.

i3 : double(2 + 3*ii)

o3 = 2

o3 : ForeignObject of type double

Ways to use this method: