This HTML automatically generated with rman for NEMO
Table of Contents


sqr, qbe, log2, dex - some additional math functions: square, cube, log


#include <stdinc.h>double sqr(double x)double qbe(double x)double log2(double
x)double dec(double x)double powi(double x, int p)double powd(double x,
double p)


sqr(x) returns the square of x, qbe(x) returns the cube root of x, dec(x) returns 10 to the power of x, and log2(x) returns the log to the base two of x. powi(x,p) return the x^p, where p is any integer, including negative, and the sign of x is taken into account properly powd(x,p) return the x^p, where for x<0 a value of 0 is returned (some machines return NaN, others may fail).


some systems may actually implement some of these functions in their own math (-lm) library


src/kernel/misc      log2.c sqr.c

See Also



4-mar-94    documented    pjt
9-jan-05    added powi,powd    pjt

Table of Contents