package ctypes

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module LDoubleSource

Sourcetype t

The type of long doubles.

Sourceval to_float : t -> float

Convert a long double to a float. The result is unspecified if the argument is either too large or too small to be represented as a float.

Sourceval of_float : float -> t

Create a long double from a float

Sourceval to_int : t -> int

Convert a long double to an int. The result is unspecified if the argument is NAN or falls outside the range of representable integers.

Sourceval of_int : int -> t

Create a long double from an int

Sourceval to_string : ?width:int -> ?prec:int -> t -> string

Convert a long double to a string.

width specifies the minimum number of digits to format the string with. A negative value left aligns. The default is 0.

prec specifies the number of digits after the decimal point. The default is 6.

Sourceval of_string : string -> t

Create a long double from a string

Sourceval add : t -> t -> t

Addition

Sourceval sub : t -> t -> t

Subtraction

Sourceval mul : t -> t -> t

Multiplication

Sourceval div : t -> t -> t

Division

Sourceval neg : t -> t

Negation

Sourceval pow : t -> t -> t

Exponentiation

Sourceval sqrt : t -> t

Square root

Sourceval exp : t -> t

Exponential

Sourceval log : t -> t

Natural logarithm

Sourceval log10 : t -> t

Base 10 logarithm

Sourceval expm1 : t -> t

expm1 x computes exp x -. 1.0, giving numerically-accurate results even if x is close to 0.0.

Sourceval log1p : t -> t

log1p x computes log(1.0 +. x) (natural logarithm), giving numerically-accurate results even if x is close to 0.0.

Sourceval cos : t -> t

Cosine. Argument is in radians.

Sourceval sin : t -> t

Sine. Argument is in radians.

Sourceval tan : t -> t

Tangent. Argument is in radians.

Sourceval acos : t -> t

Arc cosine

Sourceval asin : t -> t

Arc sine

Sourceval atan : t -> t

Arc tangent

Sourceval atan2 : t -> t -> t

atan2 y x returns the arc tangent of y /. x.

Sourceval hypot : t -> t -> t
Sourceval cosh : t -> t

Hyperbolic cosine

Sourceval sinh : t -> t

Hyperbolic sine

Sourceval tanh : t -> t

Hyperbolic tangent

Sourceval acosh : t -> t

Inverse hyperbolic cosine

Sourceval asinh : t -> t

Inverse hyperbolic sine

Sourceval atanh : t -> t

Inverse hyperbolic tangent

Sourceval ceil : t -> t

Round above to an integer value.

Sourceval floor : t -> t

Round below to an integer value.

Sourceval abs : t -> t

abs f returns absolute value of f

Sourceval rem : t -> t -> t

rem x y is the remainder of dividing x by y

Sourceval copysign : t -> t -> t

copysign x y returns a float whose absolute value is that of x and whose sign is that of y.

Sourceval frexp : t -> t * int

frexp f returns the pair of the significant and the exponent of f.

Sourceval ldexp : t -> int -> t

ldexp x n returns x *. 2 ** n.

Sourceval modf : t -> t * t

return (fractional,integer) parts of number.

Known fatal bug on mingw32; see https://sourceforge.net/p/mingw-w64/bugs/478

Sourceval classify : t -> fpclass

Return the class of the given floating-point number: normal, subnormal, zero, infinite, or not a number.

Sourceval min_float : t

The smallest positive, non-zero, non-denormalized value

Sourceval max_float : t

The largest positive finite value

Sourceval epsilon : t

The difference between 1.0 and the smallest exactly representable floating-point number greater than 1.0.

Sourceval nan : t

A special floating-point value denoting the result of an undefined operation such as 0.0 /. 0.0. Stands for 'not a number'.

Sourceval infinity : t

Positive infinity

Sourceval neg_infinity : t

Negative infinity

Sourceval zero : t

0.0

Sourceval one : t

1.0

Sourceval byte_sizes : int * int

size, in bytes, used for storing long doubles, and the actual number of bytes used by the value. (unused bytes may contain undefined values)

Sourceval mant_dig : int

size of mantissa

OCaml

Innovation. Community. Security.