Changeset 13658 in project


Ignore:
Timestamp:
03/10/09 10:05:16 (11 years ago)
Author:
Kon Lovett
Message:

Release.

Location:
release/4/number-limits/tags/2.0.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/number-limits/tags/2.0.0/float-limits.scm

    r13653 r13658  
    4444
    4545
    46 ;;;
     46;;; float-limits
    4747
    4848(module float-limits (;export
  • release/4/number-limits/tags/2.0.0/int-limits.scm

    r13653 r13658  
    2121# define UNSIGNED_LONG_LONG_SIZE  -1
    2222#endif
     23
     24*define MOST_POSITIVE_INT32 ((int32_t)(0x7fffffffUL))
     25*define MOST_POSITIVE_INT64 ((int64_t)(0x7fffffffffffffffLL))
    2326<#
    2427
    2528
    26 ;;;
     29;;; int-limits
    2730
    2831(module int-limits (;export
    2932  ;
     33  machine-word-bits machine-word-precision
     34  maximum-unsigned-machine-word
     35  most-negative-machine-word most-positive-machine-word
     36  ;
    3037  unsigned-integer32-size
    3138  maximum-unsigned-integer32
     39  most-negative-integer32 most-positive-integer32
    3240  ;
    33   machine-word-bits
    34   machine-word-precision
    35   maximum-machine-word
    36   most-negative-machine-word
    37   most-positive-machine-word
     41  unsigned-integer64-size
     42  maximum-unsigned-integer64
     43  most-negative-integer64 most-positive-integer64
    3844  ;
    3945  char-size       unsigned-char-size
     
    4551(import scheme chicken foreign)
    4652
    47 ;;
    48 
    49 (define unsigned-integer32-size (foreign-value "sizeof( uint32_t )" unsigned-int))
    50 (define maximum-unsigned-integer32 (foreign-value "((uint32_t)(~0U))" unsigned-integer32))
    51 
    52 ;;
     53;; machine-word
    5354
    5455(define machine-word-bits (foreign-value "C_WORD_SIZE" int))
    5556(define machine-word-precision (foreign-value "(C_WORD_SIZE - 1)" int))
    56 (define maximum-machine-word (foreign-value "C_UWORD_MAX" unsigned-long))
     57(define maximum-unsigned-machine-word (foreign-value "C_UWORD_MAX" unsigned-long))
    5758(define most-negative-machine-word (foreign-value "C_WORD_MIN" long))
    5859(define most-positive-machine-word (foreign-value "C_WORD_MAX" long))
    5960
    60 ;;
     61;; integer32
     62
     63(define unsigned-integer32-size (foreign-value "sizeof( uint32_t )" int))
     64(define maximum-unsigned-integer32 (foreign-value "((uint32_t)(~0UL))" unsigned-integer32))
     65(define most-negative-integer32 (foreign-value "(-MOST_POSITIVE_INT32 - 1)" integer32))
     66(define most-positive-integer32 (foreign-value "MOST_POSITIVE_INT32" integer32))
     67
     68;; integer64
     69
     70(define unsigned-integer64-size (foreign-value "sizeof( uint64_t )" int))
     71(define maximum-unsigned-integer64 (foreign-value "((uint64_t)(~0ULL))" unsigned-integer64))
     72(define most-negative-integer64 (foreign-value "(-MOST_POSITIVE_INT64 - 1)" integer64))
     73(define most-positive-integer64 (foreign-value "MOST_POSITIVE_INT64" integer64))
     74
     75;; char
    6176
    6277(define unsigned-char-size (foreign-value "sizeof( unsigned char )" int))
    6378(define char-size (foreign-value "sizeof( unsigned char )" int))
    6479
     80;; short
     81
    6582(define unsigned-short-size (foreign-value "sizeof( unsigned short )" int))
    6683(define short-size (foreign-value "sizeof( unsigned short )" int))
     84
     85;; int
    6786
    6887(define unsigned-int-size (foreign-value "sizeof( unsigned int )" int))
    6988(define int-size (foreign-value "sizeof( unsigned int )" int))
    7089
     90;; long
     91
    7192(define unsigned-long-size (foreign-value "sizeof( unsigned long )" int))
    7293(define long-size (foreign-value "sizeof( unsigned long )" int))
     94
     95;; long-long
    7396
    7497(define unsigned-long-long-size (foreign-value "UNSIGNED_LONG_LONG_SIZE" int))
Note: See TracChangeset for help on using the changeset viewer.