MLGetReal64List() and numbers out of machine precision
- To: mathgroup at smc.vnet.net
- Subject: [mg113370] MLGetReal64List() and numbers out of machine precision
- From: Crni Gorac <cgorac at gmail.com>
- Date: Tue, 26 Oct 2010 05:32:08 -0400 (EDT)
What should be the default behavior of MLGetReal64List() function when some numbers in the list of real numbers created by Mathematica, and passed to C code through this function, are out of machine precision (for example: either very very small, or very very large numbers)? I'm writing some C codes to be called from Mathematica, and when I use above function to fetch the list from Mathematica into C code, no error is reported (function returns non-zero value), but values stored in memory by this function are unrelated to actual values put in list by my Mathematica test code before my C code called in case these actual values are out of machine precision... Is there a way to "cast" values to machine precision in Mathematica? I tried with N, and half-dozen other possible approaches, but to no avail... Thanks.