ATSLIB/prelude/float

This package contains various functions on floating point numbers of single precision, double precision, and long double precision.


  • g0float_aop_type
  • g0float_cmp_type
  • g0float_add
  • g0float_sub
  • g0float_mul
  • g0float_div
  • g0float_mod
  • g0float_lt
  • g0float_lte
  • g0float_gt
  • g0float_gte
  • g0float_eq
  • g0float_neq
  • g0float_max
  • g0float_min
  • fprint_float
  • print_float
  • prerr_float
  • fprint_double
  • print_double
  • prerr_double
  • fprint_ldouble
  • print_ldouble
  • prerr_ldouble
  • Overloaded Symbols
  • ~
  • neg
  • abs
  • succ
  • pred
  • half
  • +
  • -
  • *
  • /
  • mod
  • <
  • <=
  • >
  • >=
  • =
  • !=
  • compare
  • max
  • min
  • print
  • prerr
  • fprint

  • g0float_aop_type

    Synopsis

    typedef
    g0float_aop_type (tk:tk) =
      (g0float (tk), g0float (tk)) -<fun0> g0float (tk)

    g0float_cmp_type

    Synopsis

    typedef
    g0float_cmp_type (tk:tk) =
      (g0float(tk), g0float(tk)) -<fun0> bool

    g0float_add

    Synopsis

    fun
    {tk:tk}
    g0float_add : g0float_aop_type(tk)

    Description

    This is the generic addition function on floating point numbers.

    g0float_sub

    Synopsis

    fun
    {tk:tk}
    g0float_sub : g0float_aop_type(tk)

    Description

    This is the generic subtraction function on floating point numbers.

    g0float_mul

    Synopsis

    fun
    {tk:tk}
    g0float_mul : g0float_aop_type(tk)

    Description

    This is the generic multiplication function on floating point numbers.

    g0float_div

    Synopsis

    fun
    {tk:tk}
    g0float_div : g0float_aop_type(tk)

    Description

    This is the generic division function on floating point numbers.

    g0float_mod

    Synopsis

    fun
    {tk:tk}
    g0float_mod : g0float_aop_type(tk)

    Description

    This is the generic modulo function on floating point numbers.

    g0float_lt

    Synopsis

    fun
    {tk:tk}
    g0float_lt : g0float_cmp_type(tk)

    Description

    This function returns true if and only if its first argument is less than its second argument.

    g0float_lte

    Synopsis

    fun
    {tk:tk}
    g0float_lte : g0float_cmp_type(tk)

    Description

    This function returns true if and only if its first argument is less than or equal to its second argument.

    g0float_gt

    Synopsis

    fun
    {tk:tk}
    g0float_gt : g0float_cmp_type(tk)

    Description

    This function returns true if and only if its first argument is greater than its second argument.

    g0float_gte

    Synopsis

    fun
    {tk:tk}
    g0float_gte : g0float_cmp_type(tk)

    Description

    This function returns true if and only if its first argument is greater than or equal to its second argument.

    g0float_eq

    Synopsis

    fun
    {tk:tk}
    g0float_eq : g0float_cmp_type(tk)

    Description

    This function returns true if and only if its first argument is equal to its second argument.

    g0float_neq

    Synopsis

    fun
    {tk:tk}
    g0float_neq : g0float_cmp_type(tk)

    Description

    This function returns true if and only if its first argument is unequal to its second argument.

    g0float_max

    Synopsis

    fun{tk:tk}
    g0float_max : g0float_aop_type(tk)

    Description

    This function returns the maximum of two given floating point numbers.

    g0float_min

    Synopsis

    fun{tk:tk}
    g0float_min : g0float_aop_type(tk)

    Description

    This function returns the minimum of two given floating point numbers.

    fprint_float

    Synopsis

    fun fprint_float : fprint_type (float) = "mac#%"

    Description

    This function prints a single-precision floating point number.

    print_float

    Synopsis

    fun print_float (float): void = "mac#%"

    prerr_float

    Synopsis

    fun prerr_float (float): void = "mac#%"

    fprint_double

    Synopsis

    fun fprint_double : fprint_type (double) = "mac#%"

    Description

    This function prints a double-precision floating point number.

    print_double

    Synopsis

    fun print_double (double): void = "mac#%"

    prerr_double

    Synopsis

    fun prerr_double (double): void = "mac#%"

    fprint_ldouble

    Synopsis

    fun fprint_ldouble : fprint_type (ldouble) = "mac#%"

    Description

    This function prints a long double-precision floating point number.

    print_ldouble

    Synopsis

    fun print_ldouble (ldouble): void = "mac#%"

    prerr_ldouble

    Synopsis

    fun prerr_ldouble (ldouble): void = "mac#%"

    Overloaded Symbols


    ~

    Synopsis

    overload ~ with g0float_neg of 0 // ~ for uminus

    neg

    Synopsis

    overload neg with g0float_neg of 0

    abs

    Synopsis

    overload abs with g0float_abs of 0

    succ

    Synopsis

    overload succ with g0float_succ of 0

    pred

    Synopsis

    overload pred with g0float_pred of 0

    half

    Synopsis

    Synopsis for [half] is unavailable.

    +

    Synopsis

    overload + with g0float_add of 0
    overload + with add_int_float of 0
    overload + with add_float_int of 0
    overload + with add_int_double of 0
    overload + with add_double_int of 0

    -

    Synopsis

    overload - with g0float_sub of 0
    overload - with sub_int_float of 0
    overload - with sub_float_int of 0
    overload - with sub_int_double of 0
    overload - with sub_double_int of 0

    *

    Synopsis

    overload * with g0float_mul of 0
    overload * with mul_int_float of 0
    overload * with mul_float_int of 0
    overload * with mul_int_double of 0
    overload * with mul_double_int of 0

    /

    Synopsis

    overload / with g0float_div of 0
    overload / with div_int_float of 0
    overload / with div_float_int of 0
    overload / with div_int_double of 0
    overload / with div_double_int of 0

    mod

    Synopsis

    overload mod with g0float_mod of 0

    <

    Synopsis

    overload < with g0float_lt of 0

    <=

    Synopsis

    overload <= with g0float_lte of 0

    >

    Synopsis

    overload > with g0float_gt of 0

    >=

    Synopsis

    overload >= with g0float_gte of 0

    =

    Synopsis

    overload = with g0float_eq of 0

    !=

    Synopsis

    overload != with g0float_neq of 0

    compare

    Synopsis

    overload compare with g0float_compare of 0

    max

    Synopsis

    overload max with g0float_max of 0

    min

    Synopsis

    overload min with g0float_min of 0

    print

    Synopsis

    overload print with print_float
    overload print with print_double
    overload print with print_ldouble

    prerr

    Synopsis

    overload prerr with prerr_float
    overload prerr with prerr_double
    overload prerr with prerr_ldouble

    fprint

    Synopsis

    overload fprint with fprint_float
    overload fprint with fprint_double
    overload fprint with fprint_ldouble

    This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. SourceForge.net Logo