Panda3D

Functions
cmath.h File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

`#include "dtoolbase.h"`
`#include <cmath>`
`#include <cfloat>`
`#include <limits>`
`#include "cmath.I"`

Go to the source code of this file.

## Functions
double | cabs (double v)
float | cabs (float v)
double | cacos (double v)
float | cacos (float v)
double | casin (double v)
float | casin (float v)
double | catan (double v)
float | catan (float v)
double | catan2 (double y, double x)
float | catan2 (float y, float x)
double | cceil (double f)
double | ccos (double v)
float | ccos (float v)
double | cfloor (double f)
double | cfrac (double f)
| Returns the fractional component of f: f - cfloor(f). More...
bool | cinf (double v)
bool | cinf (float v)
double | cmod (double x, double y)
| This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive. More...
float | cmod (float x, float y)
| This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive. More...
int | cmod (int x, int y)
| This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive. More...
bool | cnan (double v)
bool | cnan (float v)
double | cpow (double x, double y)
float | cpow (float x, float y)
int | cpow (int x, int y)
double | csin (double v)
float | csin (float v)
float | csin_over_x (float v)
| Computes sin(x) / x, well-behaved as x approaches 0. More...
void | csincos (double v, double *sin_result, double *cos_result)
void | csincos (float v, float *sin_result, float *cos_result)
double | csqrt (double v)
float | csqrt (float v)
double | ctan (double v)
float | ctan (float v)
double | make_inf (double)
float | make_inf (float)
double | make_nan (double)
float | make_nan (float)

## Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
  drose

Date
  2000-05-19

Definition in file cmath.h.

## Function Documentation

## ◆ cfrac()

double cfrac | ( | double | f | ) |
| inline

Returns the fractional component of f: f - cfloor(f).

Definition at line 183 of file cmath.I.

## ◆ cmod() [1/3]

double cmod | ( | double | x,
|  | double | y
| ) |  |
| inline

This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.

Definition at line 297 of file cmath.I.

## ◆ cmod() [2/3]

float cmod | ( | float | x,
|  | float | y
| ) |  |
| inline

This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.

Definition at line 130 of file cmath.I.

## ◆ cmod() [3/3]

int cmod | ( | int | x,
|  | int | y
| ) |  |
| inline

This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.

This integer-valued function is provided since the built-in modulo operator % does not work properly for negative x.

Definition at line 434 of file cmath.I.

## ◆ csin_over_x()

float csin_over_x | ( | float | v | ) |
| inline

Computes sin(x) / x, well-behaved as x approaches 0.

Definition at line 77 of file cmath.I.