epix-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ePiX-users] Math functions


From: Andrew D. Hwang
Subject: Re: [ePiX-users] Math functions
Date: Fri, 18 Apr 2008 17:05:48 -0400 (EDT)

On Fri, 18 Apr 2008, José Alexandre Nalon wrote:

[...] So I tried

p = exp(b*log(abs(a)));

with the same results. Didn't try using Abs(), though. Is
there a quick reference of the available functions in ePiX?

Hi José,

The expression exp(b*log(abs(a))) should only return nan when a=0 (or if a or b is inf or nan), but it sounds like many of your inputs have a=0. The <cmath> header (automatically included by epix.h) defines pow(a,b) for a^b and correctly handles a=0:

  p = pow(a,b);

If that doesn't work, please feel free to post a minimal example.

Section 3.7.3 of the manual lists a few common <cmath> functions (sqrt,
exp, log, log10, cosh, acosh (etc.), ceil, floor, fabs), but the GNU C
library defines many more. :)

The trig and inverse trig functions with capitalized names are sensitive
to angle units (radians, degrees, revolutions). In degrees mode, Cos has
period 360, and Acos takes values between 0 and 180, for example.

--
Andy

Andrew D. Hwang                 address@hidden
Department of Math and CS       http://mathcs.holycross.edu/~ahwang
College of the Holy Cross       (508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395       (508) 793-3530 (fax)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]