Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: In search of cbrt() ... Keywords: Gaphics Gems, cbrt() for TC++ Message-ID: <4502@goanna.cs.rmit.oz.au> Date: 14 Dec 90 06:09:11 GMT References: <14724@smoke.brl.mil> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 16 In article <14724@smoke.brl.mil>, gwyn@smoke.brl.mil (Doug Gwyn) writes: > In article rcruz@paul.rutgers.edu (Rafael Cruz) writes: > >... make use of the library function cbrt(). cbrt() is part of the Berkeley math library. > However, if all it does is extract a cube-root, it's trivial to emulate: > #include > #define cubrt(x) pow(x,1.0/3.0) That doesn't quite do the job. cbrt(-8.0) is -2.0, but pow(-8.0, 1.0/3.0) prints "DOMAIN error" and returns 0.0. -- The Marxists have merely _interpreted_ Marxism in various ways; the point, however, is to _change_ it. -- R. Hochhuth.