Changes between Version 17 and Version 18 of FlonumsCowan


Ignore:
Timestamp:
09/14/16 16:52:56 (9 months ago)
Author:
cowan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FlonumsCowan

    v17 v18  
    8989 
    9090Value of `(flinteger-binary-log +0.nan)`.  (C99 `FP_ILOGBNAN`) 
     91 
     92`fl-radix` 
     93 
     94Value of the floating-point radix (2 on most machines). 
    9195 
    9296== Constructors == 
     
    171175difference or quotient of their arguments, associating to the 
    172176left.  With one argument, however, they return the additive or 
    173 multiplicative inverse of their argument.  In general, they 
     177multiplicative inverse of their argument. 
     178 
     179In general, they 
    174180should return the flonum that best approximates the mathematical 
    175181difference or quotient.  For undefined quotients, `fl/` 
    176182behaves as specified by the 
    177 IEEE standards. 
    178  
    179 For implementations that represent flonums 
     183IEEE standards.  For implementations that represent flonums 
    180184using IEEE binary floating point, the meaning of "best" is 
    181185reasonably well-defined by the IEEE standards. 
     
    185189`(flmin `''x'' ...`)` 
    186190 
    187 Return the maximum/minimum argument.  If there are no arguments, these procedures return `+inf.0`/`-inf.0` if the implementation provides these numbers, and `fl-maximum` / its negation otherwise. 
     191Return the maximum/minimum argument.  If there are no arguments, 
     192these procedures return `+inf.0`/`-inf.0` if the implementation 
     193provides these numbers, and `fl-maximum` / its negation otherwise. 
    188194 
    189195`(flabs `''x''`)` 
     
    227233 
    228234 
    229 Although infinities and NaNs are not integer objects, these procedures return 
     235Although infinities and NaNs are not integers, these procedures return 
    230236an infinity when given an infinity as an argument, and a NaN when 
    231237given a NaN. 
     
    233239=== Exponents and logarithms === 
    234240 
    235  
     241{{{ 
     242flexp   double exp(double)      ex 
     243fl2     double exp2(double)     base-2 exponential 
     244flexp-minus-1   double expm1(double)    exp-1 
     245flsquare 
     246flsqrt 
     247flcbrt  double cbrt(double)     cube root 
     248flhypot double hypot(double, double)    sqrt(x2+y2) 
     249flexp 
     250fl2exp  double ldexp(double x, int n)   x*2n 
     251flexponent      double logb(double x)   the exponent of x, which is the integral part of 
     252log_r(|x|), as a signed floating-point value, for non-zero x, where r is the radix of the machine's floating-point arithmetic 
     253flfraction-exponent     double modf(double, double *)   returns two values, fraction and int exponent 
     254flinteger-exponent      int ilogb(double)       binary log as int 
     255fllog 
     256fllog2  double log2(double)     log base 2 
     257fllog10 double log10(double)    log base 10 
     258fllog+1 double log1p(double x)  log (1+x) 
     259flnormalized-fraction-exponent  double frexp(double, int *) 
     260returns two values, fraction in range [1/2,1) and int exponent 
     261flscalbn        double scalbn(double x, int y)  x*ry, where r is the machine float radix 
     262}}} 
     263 
     264The `flsqrt` procedure returns the principal square root of ''x''. For -0.0, 
     265`flsqrt` should return -0.0. 
     266 
     267The `flexpt` procedure returns ''x'' raised to the power 'y'' 
     268if ''x'' is non-negative or ''y'' is an integral flonum.  If ''x'' is 
     269negative and ''y'' is not an integer, the result may be a 
     270NaN, or may be some unspecified flonum.  If ''x'' is zero, then 
     271the result is zero. 
    236272 
    237273=== Trigonometric functions === 
     
    265301should follow the relevant standards for these procedures. 
    266302 
    267 ||`flremquo`||`double      remquo(double, double, int *)`||returns two values, rounded remainder and low-order ''n'' bits of the quotient (''n'' is implementation-defined) 
     303`(flremquo `''x y''`)` 
     304 
     305Returns two values, the result of `(flround-remainder x y)` and the low-order ''n'' bits (as a correctly signed exact integer) of the rounded quotient.  The value of ''n'' is implementation-dependent but at least 3.  This function can be used to reduce the argument of the inverse trigonometric functions, while preserving the correct quadrant or octant. 
    268306 
    269307 
     
    294332||`flsecond-bessel`||`double      yn(int n, double)`||bessel function of the second kind, order ''n''|| 
    295333 
    296 === Junk === 
    297  
    298 {{{ 
    299 #!html 
    300 Returns the principal square root of <i>fl</i>. For &minus;0.0, 
    301 <tt>flsqrt</tt> should return &minus;0.0; for other negative arguments, 
    302 the result may be a NaN or some unspecified flonum.</p> 
    303 <p> 
    304 </p> 
    305  
    306 <div align=left><tt>(<a name="node_idx_1046"></a>flexpt<i> <i>fl<sub>1</sub></i> <i>fl<sub>2</sub></i></i>)</tt><span style="margin-left: .5em">&zwnj;</span><span style="margin-left: .5em">&zwnj;</span>procedure&nbsp;</div> 
    307 <p> 
    308 Either <i>fl<sub>1</sub></i> should be non-negative, or, if <i>fl<sub>1</sub></i> is 
    309 negative, <i>fl<sub>2</sub></i> should be an integer object. 
    310 The <tt>flexpt</tt> procedure returns <i>fl<sub>1</sub></i> raised to the power <i>fl<sub>2</sub></i>.  If <i>fl<sub>1</sub></i> is 
    311 negative and <i>fl<sub>2</sub></i> is not an integer object, the result may be a 
    312 NaN, or may be some unspecified flonum.  If <i>fl<sub>1</sub></i> is zero, then 
    313 the result is zero. 
    314  
    315 }}} 
    316  
    317  
    318 === Decoding flonums === 
    319  
    320 decode-float float => significand, exponent, sign 
    321  
    322 scale-float float integer => scaled-float 
    323  
    324 float-radix float => float-radix 
    325  
    326 float-sign float-1 &optional float-2 => signed-float 
    327  
    328 float-digits float => digits1 
    329  
    330 float-precision float => digits2 
    331  
    332 integer-decode-float float => significand, exponent, integer-sign 
    333  
    334  
    335  
    336 Description: 
    337  
    338 decode-float computes three values that characterize float. The first value is of the same type as float and represents the significand. The second value represents the exponent to which the radix (notated in this description by b) must be raised to obtain the value that, when multiplied with the first result, produces the absolute value of float. If float is zero, any integer value may be returned, provided that the identity shown for scale-float holds. The third value is of the same type as float and is 1.0 if float is greater than or equal to zero or -1.0 otherwise. 
    339  
    340 decode-float divides float by an integral power of b so as to bring its value between 1/b (inclusive) and 1 (exclusive), and returns the quotient as the first value. If float is zero, however, the result equals the absolute value of float (that is, if there is a negative zero, its significand is considered to be a positive zero). 
    341  
    342 scale-float returns `(* float (expt (float b float) integer))`, where b is the radix of the floating-point representation. float is not necessarily between 1/b and 1. 
    343  
    344 float-radix returns the radix of float. 
    345  
    346 float-sign returns a number z such that z and float-1 have the same sign and also such that z and float-2 have the same absolute value. If float-2 is not supplied, its value is `(float 1 float-1)`. If an implementation has distinct representations for negative zero and positive zero, then `(float-sign -0.0) => -1.0`. 
    347  
    348 float-digits returns the number of radix b digits used in the representation of float (including any implicit digits, such as a ``hidden bit''). 
    349  
    350 float-precision returns the number of significant radix b digits present in float; if float is a float zero, then the result is an integer zero. 
    351  
    352 For normalized floats, the results of float-digits and float-precision are the same, but the precision is less than the number of representation digits for a denormalized or zero number. 
    353  
    354 integer-decode-float computes three values that characterize float - the significand scaled so as to be an integer, and the same last two values that are returned by decode-float. If float is zero, integer-decode-float returns zero as the first value. The second value bears the same relationship to the first value as for decode-float: 
    355  
    356 {{{ 
    357  (multiple-value-bind (signif expon sign) 
    358                       (integer-decode-float f) 
    359    (scale-float (float signif f) expon)) ==  (abs f) 
    360 }}} 
    361  
    362 === NaN functions === 
    363  
    364 The following functions are applicable not only to flonum NaNs but to all inexact real NaNs, which is why their names do not begin with `fl`. 
    365  
    366 `(make-nan `''payload''`)` 
    367  
    368 Returns a NaN, using the exact integer ''payload'' in an implementation-defined way to generate the payload bits.  In particular, the sign bit of the NaN is set from the sign of `payload`.  If the implementation does not support NaNs, it is an error. 
    369  
    370 `(nan-payload `''nan''`)` 
    371  
    372 Returns the payload of ''nan''. 
    373  
    374 `(nan-signaling? `''nan''`)` 
    375  
    376 Returns `#t` if ''nan'' is a signaling NaN, and `#f` otherwise.  This function is required because different floating-point processors implement the signaling bit in different ways: on most processors, the most significant bit of the payload is clear if the NaN is signaling, but on the PA-RISC and MIPS processors it is set. 
    377  
    378 `(nan= `''x y''`)` 
    379  
    380 Returns `#t` if ''x'' and ''y'' are both NaNs the same payload. 
    381  
    382  
    383  
    384  
     334 
     335 
     336