11 Numbers
(require scramble/number) | package: scramble-lib |
procedure
(ceiling-quotient n d) → exact-integer?
n : exact-integer? d : exact-positive-integer?
> (ceiling-quotient 7 4) 2
> (ceiling-quotient 8 4) 2
> (ceiling-quotient 9 4) 3
procedure
(ceiling-multiple n d) → exact-integer?
n : exact-integer? d : exact-positive-integer?
Equivalent to (* d (ceiling-quotient n d)).
> (ceiling-multiple 7 4) 8
> (ceiling-multiple 8 4) 8
> (ceiling-multiple 9 4) 12
procedure
(floor-quotient n d) → exact-integer?
n : exact-integer? d : exact-positive-integer?
procedure
(floor-multiple n d) → exact-integer?
n : exact-integer? d : exact-positive-integer?
procedure
(string->integer s [ #:min min-value #:max max-value]) → (or/c exact-integer? #f) s : string? min-value : real? = -inf.0 max-value : real? = +inf.0
> (string->integer "123" #:min 0 #:max 100) #f
> (string->integer "123" #:min 0 #:max 500) 123
> (string->integer "1e3") ; exponentials are not allowed #f
> (string->integer "#x10") ; radix markers are not allowed #f
Added in version 0.4 of package scramble-lib.
value
MIN-INT8 : exact-integer? = (- (expt 2 7))
value
MIN-INT16 : exact-integer? = (- (expt 2 15))
value
MIN-INT32 : exact-integer? = (- (expt 2 31))
value
MIN-INT64 : exact-integer? = (- (expt 2 63))
value
MIN-INT128 : exact-integer? = (- (expt 2 127))
value
MIN-INT256 : exact-integer? = (- (expt 2 255))
Added in version 0.4 of package scramble-lib.
value
MAX-INT8 : exact-integer? = (sub1 (expt 2 7))
value
MAX-INT16 : exact-integer? = (sub1 (expt 2 15))
value
MAX-INT32 : exact-integer? = (sub1 (expt 2 31))
value
MAX-INT64 : exact-integer? = (sub1 (expt 2 63))
value
MAX-INT128 : exact-integer? = (sub1 (expt 2 127))
value
MAX-INT256 : exact-integer? = (sub1 (expt 2 255))
Added in version 0.4 of package scramble-lib.
value
MAX-UINT8 : exact-integer? = (sub1 (expt 2 16))
value
MAX-UINT16 : exact-integer? = (sub1 (expt 2 16))
value
MAX-UINT32 : exact-integer? = (sub1 (expt 2 32))
value
MAX-UINT64 : exact-integer? = (sub1 (expt 2 64))
value
MAX-UINT128 : exact-integer? = (sub1 (expt 2 128))
value
MAX-UINT256 : exact-integer? = (sub1 (expt 2 256))
Added in version 0.4 of package scramble-lib.
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
Added in version 0.4 of package scramble-lib.
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
procedure
v : any/c
Added in version 0.4 of package scramble-lib.