module watt.math.floating

Floating point maths functions.

Code Map

//! Floating point maths functions.
module watt.math.floating;


//! The number PI as a constant.
enum PIf;
//! The number PI as a constant.
enum PI;

//! Calculate the sine function of a number.
alias sin = sinf;
//! Calculate the cosine function of a number.
alias cos = cosf;
//! Calculate the tangent function of a number.
alias tan = tanf;
//! Calculate the square root of a number.
alias sqrt = sqrtf;

//! Calculate the sine function of a number.
fn sin(f64) f64;
//! Calculate the sine function of a number.
fn sinf(f32) f32;
//! Calculate the cosine function of a number.
fn cos(f64) f64;
//! Calculate the cosine function of a number.
fn cosf(f32) f32;
//! Calculate the tangent function of a number.
fn tan(f64) f64;
//! Calculate the tangent function of a number.
fn tanf(f32) f32;
//! Calculate the square root of a number.
fn sqrt(f64) f64;
//! Calculate the square root of a number.
fn sqrtf(f32) f32;
//! Convert radians into degrees.
fn radians(degs: f64) f64 { }
//! Convert degrees into radians.
fn degrees(rads: f64) f64 { }
//! Round a value down.
fn floor(f32) f32;
//! Round a value down.
fn floor(f64) f64;
//! Round a value up.
fn ceil(f32) f32;
//! Round a value up.
fn ceil(f64) f64;
//! Round a value to the nearest integer.
fn round(f32) f32;
//! Round a value to the nearest integer.
fn round(f64) f64;
//! Raise the value to the given (positive or negative) power.
fn pow(value: f32, power: f32) f32;
//! Raise the value to the given (positive or negative) power.
fn pow(value: f64, power: f64) f64;
fn abs(f32) f32;
fn abs(f64) f64;
enum PIf

The number PI as a constant.

enum PI

The number PI as a constant.

fn sin(f64) f64

Calculate the sine function of a number.

fn sinf(f32) f32

Calculate the sine function of a number.

alias sin

Calculate the sine function of a number.

fn cos(f64) f64

Calculate the cosine function of a number.

fn cosf(f32) f32

Calculate the cosine function of a number.

alias cos

Calculate the cosine function of a number.

fn tan(f64) f64

Calculate the tangent function of a number.

fn tanf(f32) f32

Calculate the tangent function of a number.

alias tan

Calculate the tangent function of a number.

fn sqrt(f64) f64

Calculate the square root of a number.

fn sqrtf(f32) f32

Calculate the square root of a number.

alias sqrt

Calculate the square root of a number.

fn radians(degs: f64) f64

Convert radians into degrees.

fn degrees(rads: f64) f64

Convert degrees into radians.

fn floor(f32) f32

Round a value down.

fn ceil(f32) f32

Round a value up.

fn round(f32) f32

Round a value to the nearest integer.

fn pow(value: f32, power: f32) f32

Raise the value to the given (positive or negative) power.

Parameters

value

The value to power.

power

Number to reaise the value with.

fn abs(f32) f32

Return

the absolute value of the given argument.