 Timestamp:
 03/07/09 17:08:16 (11 years ago)
 Location:
 chicken/trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

chicken/trunk/library.scm
r13304 r13562 41 41 #include <errno.h> 42 42 #include <time.h> 43 #include <float.h> 43 44 44 45 #ifdef HAVE_SYSEXITS_H … … 733 734 ;;; Numeric routines: 734 735 736 (define mostpositivefixnum (foreignvalue "C_MOST_POSITIVE_FIXNUM" int)) 737 (define mostnegativefixnum (foreignvalue "C_MOST_NEGATIVE_FIXNUM" int)) 738 (define fixnumbits (foreignvalue "(C_WORD_SIZE  1)" int)) 739 (define fixnumprecision (foreignvalue "(C_WORD_SIZE  (1 + 1))" int)) 740 735 741 (define (fixnum? x) (##core#inline "C_fixnump" x)) 736 742 (define (fx+ x y) (##core#inline "C_fixnum_plus" x y)) … … 769 775 (fxcheckdivisonbyzero x y 'fxmod) 770 776 (##core#inline "C_fixnum_modulo" x y) ] ) ) 777 778 (define maximumflonum (foreignvalue "DBL_MAX" double)) 779 (define minimumflonum (foreignvalue "DBL_MIN" double)) 780 (define flonumradix (foreignvalue "FLT_RADIX" int)) 781 (define flonumepsilon (foreignvalue "DBL_EPSILON" double)) 782 (define flonumprecision (foreignvalue "DBL_MANT_DIG" int)) 783 (define flonumdecimalprecision (foreignvalue "DBL_DIG" int)) 784 (define flonummaximumexponent (foreignvalue "DBL_MAX_EXP" int)) 785 (define flonumminimumexponent (foreignvalue "DBL_MIN_EXP" int)) 786 (define flonummaximumdecimalexponent (foreignvalue "DBL_MAX_10_EXP" int)) 787 (define flonumminimumdecimalexponent (foreignvalue "DBL_MIN_10_EXP" int)) 771 788 772 789 (define (flonum? x) (##core#inline "C_i_flonump" x)) 
chicken/trunk/manual/Unit library
r11989 r13562 16 16 17 17 Adds/subtracts 1 from {{N}}. 18 18 19 19 20 ==== Binary integer operations … … 38 39 set, or {{#f}} otherwise. The rightmost/leastsignificant bit is bit 0. 39 40 40 41 ==== fixnum?42 43 [procedure] (fixnum? X)44 45 Returns {{#t}} if {{X}} is a fixnum, or {{#f}} otherwise.46 41 47 42 ==== Arithmetic fixnum operations … … 76 71 ; [procedure] (fxshr N1 N2) 77 72 73 ==== fixnum? 74 75 [procedure] (fixnum? X) 76 77 Returns {{#t}} if {{X}} is a fixnum, or {{#f}} otherwise. 78 79 ==== Fixnum limits 80 81 {{mostpositivefixnum}} 82 {{mostnegativefixnum}} 83 {{fixnumbits}} 84 {{fixnumprecision}} 85 78 86 79 87 ==== Arithmetic floatingpoint operations 80 88 81 In safe mode, these procedures throw a type error with nonfloat 82 arguments (except {{flonum?}}, which returns {{#f}}). In unsafe mode, 83 these procedures do not check their arguments. A nonflonum argument 84 in unsafe mode can crash the system. 89 In safe mode, these procedures throw a type error with nonfloat arguments. In 90 unsafe mode, these procedures do not check their arguments. A nonflonum 91 argument in unsafe mode can crash the system. 85 92 86 93 ; [procedure] (flonum? X) … … 98 105 ; [procedure] (fp<= X Y) 99 106 107 ==== flonum? 108 109 [procedure] (flonum? X) 110 111 Returns {{#t}} if {{X}} is a flonum, or {{#f}} otherwise. 112 113 ==== Flonum limits 114 115 {{maximumflonum}} 116 {{minimumflonum}} 117 {{flonumradix}} 118 {{flonumepsilon}} 119 {{flonumprecision}} 120 {{flonumdecimalprecision}} 121 {{flonummaximumexponent}} 122 {{flonumminimumexponent}} 123 {{flonummaximumdecimalexponent}} 124 {{flonumminimumdecimalexponent}} 125 126 ==== finite? 127 128 [procedure] (finite? N) 129 130 Returns {{#f}} if {{N}} is negative or positive infinity, and {{#t}} otherwise. 131 100 132 ==== signum 101 133 … … 104 136 Returns {{1}} if {{N}} is positive, {{1}} if {{N}} 105 137 is negative or {{0}} if {{N}} is zero. {{signum}} is exactness preserving. 106 107 108 ==== finite?109 110 [procedure] (finite? N)111 112 Returns {{#f}} if {{N}} is negative or positive infinity, and {{#t}} otherwise.113 138 114 139
Note: See TracChangeset
for help on using the changeset viewer.