Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cupcake!jwp From: jwp@cupcake.sal.wisc.edu (Jeffrey W Percival) Newsgroups: comp.lang.c Subject: what's the problem with modf()? Keywords: modf sun unix Message-ID: <1158@cupcake.sal.wisc.edu> Date: 30 Oct 90 18:54:42 GMT Organization: Space Astronomy Lab, Madison WI Lines: 15 I ported a C program from Ultrix to Sun 4.1, and discovered that modf() was giving me fits. Much debugging, only to discover that modf() was giving me a NaN result *sometimes*. Unpredictable, seemingly dependent on program size, linkage, etc. A real bear to find. I saw in the Sun man pages that modf() was accompanied with the warning that it may not be portable, and that there were better ways to do it. While not disputing that, I wonder what makes it flakey? Its function is well-defined, no? The output is defined for all real input, no? Can someone fill me in on this seemingly sordid topic? -- Jeffrey W Percival (jwp@larry.sal.wisc.edu) (608)262-8686