File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 11(** In Troupe, there is not per-se an `int` type. Rather, there is a `number` and some integral
22 * operations on them which treats them as if they were 32 bit signed integers. *)
33
4- let (** Largest (safe) possible integral value. Anything larger than this cannot represent an
4+ let (** Largest (safe) possible integral value. Anything larger than +1 of this cannot represent an
55 * increment of 1.
66 *
77 * NOTE: Value copied from the JavaScript documentation for `Number.MAX_SAFE_INTEGER`. *)
8- val maxInt = 9007199254740992
8+ val maxInt = 9007199254740991
99
10- (** Smallest (safe) possible integral value. Anything smaller than this cannot represent an
10+ (** Smallest (safe) possible integral value. Anything smaller than -1 this cannot represent an
1111 * increment of 1. *)
1212 val minInt = -maxInt
1313
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ import Number
33
44let val tests = Unit.group "Number" [
55 Unit.group "maxInt / minInt" [
6- Unit.it "maxInt++ = maxInt" (Unit.isEq Number.maxInt (Number.maxInt + 1))
7- , Unit.it "minInt-- = minInt" (Unit.isEq Number.minInt (Number.minInt - 1))
6+ Unit.it "maxInt++ != maxInt" (Unit.isNeq Number.maxInt (Number.maxInt + 1))
7+ , Unit.it "minInt-- != minInt" (Unit.isNeq Number.minInt (Number.minInt - 1))
8+ , Unit.it "maxInt+2 == maxInt+1" (Unit.isEq (Number.maxInt + 1) (Number.maxInt + 2))
9+ , Unit.it "minInt-2 == minInt+1" (Unit.isEq (Number.minInt - 1) (Number.minInt - 2))
810 ],
911 Unit.group "abs" [
1012 Unit.it "keeps 0 as is" (Unit.isEq 0 (Number.abs 0))
You can’t perform that action at this time.
0 commit comments