Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

passing Indeterminate and Infinity to C via MathLink

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121321] passing Indeterminate and Infinity to C via MathLink
  • From: Roman <rschmied at gmail.com>
  • Date: Sat, 10 Sep 2011 07:29:23 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hello all,
I am setting up a C function which accepts real numbers from MathLink.
The behavior I would like to achieve is that whenever the number is
"Infinity" then the C function receives "inf" (which is a valid double-
precision-format number); and whenever the number is "Indeterminate"
then the C function receives "nan" (which is also a valid double-
precision-format number).
Unfortunately MathLink (Mathematica 7.0 for Mac OS X x86 (64-bit))
crashes whenever I am trying to pass either Infinity or Indeterminate
to a MathLink function expecting a double-precision number.
Would you know how to solve this without going into If[] statements on
the Mathematica side of MathLink?
Thanks!
Roman




  • Prev by Date: Manipulate inside module
  • Next by Date: help to make code run faster (mathematica v8.01)
  • Previous by thread: Re: Manipulate inside module
  • Next by thread: Re: passing Indeterminate and Infinity to C via MathLink