compat.real-elementary-functions
- Backward-compatible real elementary functions ¶Gauche 0.9.12 and earlier had undocumented real-only elementary functions,
such as %sin
and %exp
. They were intended to be a building
block of the complex elementary functions, hence prefixed with %
.
However, they were visible in gauche
module, and sometimes used
directly because they were fast.
SRFI-94 introduced names for real-only elementary functions
such as real-sin
, so we changed built-in %sin
etc.
to follow that names. See Arithmetics, for those real-only
elementary functions.
This module is to ease migration from the legacy code that uses old names. Just add the following form at the beginning of old code and the source would work with both versions.
(cond-expand [(library (compat real-elementary-functions)) (use compat.real-elementary-functions)] [else])
New code must use real-sin
etc. instead of the names provided here.
{compat.real-elementary-functions
}
These are the same as the built-in procedures replacing preceding %
with real-
; e.g. %exp
≡ real-exp
.
See Arithmetics, for the description of built-in procedures.
{compat.real-elementary-functions
}
This is a real-only logarithm of x base base.
x must be a non-negative real
number, and base must be a positive real number.
If base is omitted, Napier’s number is assumed, that is,
it returns a natural logarithm of x.
If x is 0, -inf.0
is returned.
Gauche does not have built-in real-log
, to avoid conflict with
SRFI-94’s real-log
which takes base argument first.
For real-only natural logarithm, Gauche has real-ln
.
See scheme.flonum
- R7RS flonum, which defines flonum-only version of logarithms
sich as fllog
, fllog2
, and fllog10
.