# All files / src Relude_Int.bs.js

100% Statements 163/163
100% Branches 4/4
100% Functions 11/11
100% Lines 163/163

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361

    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x

    2x

    4x

    2x

    2x

    26x

    26x

    26x

    1x

    1x

    1x

    183x
    62x

    121x

    71x
    23x

    48x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    10x

    26x

    20x
    20x

    10x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x

    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x
    26x

     'use strict';

    var Curry = require("bs-platform/lib/js/curry.js");
    var Js_int = require("bs-platform/lib/js/js_int.js");
    var Belt_Array = require("bs-platform/lib/js/belt_Array.js");
    var Caml_int32 = require("bs-platform/lib/js/caml_int32.js");
    var Relude_Map = require("./Relude_Map.bs.js");
    var Relude_Set = require("./Relude_Set.bs.js");
    var Caml_format = require("bs-platform/lib/js/caml_format.js");
    var Int$BsAbstract = require("bs-abstract/lib/js/src/implementations/Int.bs.js");
    var Relude_Extensions_Eq = require("./extensions/Relude_Extensions_Eq.bs.js");
    var Relude_Extensions_Ord = require("./extensions/Relude_Extensions_Ord.bs.js");
    var Relude_Extensions_Ring = require("./extensions/Relude_Extensions_Ring.bs.js");
    var Relude_Extensions_Semiring = require("./extensions/Relude_Extensions_Semiring.bs.js");

    function toFloat(prim) {
      return prim;
    }

    function fromFloat(prim) {
      return prim | 0;
    }

    function add(prim, prim$1) {
      return prim + prim$1 | 0;
    }

    function subtract(prim, prim$1) {
      return prim - prim$1 | 0;
    }

    var multiply = Caml_int32.imul;

    var divide = Caml_int32.div;

    var modulo = Caml_int32.mod_;

    function divideWithModulo(a, b) {
      return /* tuple */[
              Caml_int32.div(a, b),
              Caml_int32.mod_(a, b)
            ];
    }

    function divideAsFloat(a, b) {
      return a / b;
    }

    function degree(a) {
      return Math.min(Math.abs(a), Js_int.max);
    }

    function rangeAsList(start, end_) {
      if (start >= end_) {
        return /* [] */0;
      } else {
        return /* :: */[
                start,
                rangeAsList(start + 1 | 0, end_)
              ];
      }
    }

    function rangeAsArray(start, end_) {
      if (start >= end_) {
        return /* array */[];
      } else {
        return Belt_Array.concat(/* array */[start], rangeAsArray(start + 1 | 0, end_));
      }
    }

    var eq = Int$BsAbstract.Eq.eq;

    var Eq = {
      eq: eq
    };

    var include = Relude_Extensions_Eq.EqExtensions(Eq);

    var compare = Int$BsAbstract.Ord.compare;

    var Ord = {
      eq: eq,
      compare: compare
    };

    var include$1 = Relude_Extensions_Ord.OrdExtensions(Ord);

    var OrdRingExtensions = include$1.OrdRingExtensions;

    var Semiring = {
      add: add,
      zero: 0,
      multiply: multiply,
      one: 1
    };

    Relude_Extensions_Semiring.SemiringExtensions(Semiring);

    var Ring = {
      add: add,
      zero: 0,
      multiply: multiply,
      one: 1,
      subtract: subtract
    };

    var include$2 = Relude_Extensions_Ring.RingExtensions(Ring);

    var include$3 = Curry._1(OrdRingExtensions, Ring);

    var Bounded = {
      eq: eq,
      compare: compare,
      top: Js_int.max,
      bottom: Js_int.min
    };

    var EuclideanRing = {
      add: add,
      zero: 0,
      multiply: multiply,
      one: 1,
      subtract: subtract,
      degree: degree,
      divide: divide,
      modulo: modulo
    };

    var $$Map = Relude_Map.WithOrd(Ord);

    var $$Set = Relude_Set.WithOrd(Ord);

    function show(prim) {
      return String(prim);
    }

    var Show = {
      show: show
    };

    function fromString(v) {
      try {
        return Caml_format.caml_int_of_string(v);
      }
      catch (exn){
        return ;
      }
    }

    var Additive_Magma = Int$BsAbstract.Additive.Magma;

    var Additive_Medial_Magma = Int$BsAbstract.Additive.Medial_Magma;

    var Additive_Semigroup = Int$BsAbstract.Additive.Semigroup;

    var Additive_Monoid = Int$BsAbstract.Additive.Monoid;

    var Additive_Quasigroup = Int$BsAbstract.Additive.Quasigroup;

    var Additive_Medial_Quasigroup = Int$BsAbstract.Additive.Medial_Quasigroup;

    var Additive_Loop = Int$BsAbstract.Additive.Loop;

    var Additive_Group = Int$BsAbstract.Additive.Group;

    var Additive_Abelian_Group = Int$BsAbstract.Additive.Abelian_Group;

    var Additive = {
      Magma: Additive_Magma,
      Medial_Magma: Additive_Medial_Magma,
      Semigroup: Additive_Semigroup,
      Monoid: Additive_Monoid,
      Quasigroup: Additive_Quasigroup,
      Medial_Quasigroup: Additive_Medial_Quasigroup,
      Loop: Additive_Loop,
      Group: Additive_Group,
      Abelian_Group: Additive_Abelian_Group
    };

    var Multiplicative_Magma = Int$BsAbstract.Multiplicative.Magma;

    var Multiplicative_Medial_Magma = Int$BsAbstract.Multiplicative.Medial_Magma;

    var Multiplicative_Semigroup = Int$BsAbstract.Multiplicative.Semigroup;

    var Multiplicative_Monoid = Int$BsAbstract.Multiplicative.Monoid;

    var Multiplicative_Quasigroup = Int$BsAbstract.Multiplicative.Quasigroup;

    var Multiplicative_Loop = Int$BsAbstract.Multiplicative.Loop;

    var Multiplicative = {
      Magma: Multiplicative_Magma,
      Medial_Magma: Multiplicative_Medial_Magma,
      Semigroup: Multiplicative_Semigroup,
      Monoid: Multiplicative_Monoid,
      Quasigroup: Multiplicative_Quasigroup,
      Loop: Multiplicative_Loop
    };

    var Subtractive_Magma = Int$BsAbstract.Subtractive.Magma;

    var Subtractive_Medial_Magma = Int$BsAbstract.Subtractive.Medial_Magma;

    var Subtractive_Quasigroup = Int$BsAbstract.Subtractive.Quasigroup;

    var Subtractive = {
      Magma: Subtractive_Magma,
      Medial_Magma: Subtractive_Medial_Magma,
      Quasigroup: Subtractive_Quasigroup
    };

    var Divisive = {
      Magma: Int$BsAbstract.Divisive.Magma
    };

    var Infix_Additive = Int$BsAbstract.Infix.Additive;

    var Infix_Multiplicative = Int$BsAbstract.Infix.Multiplicative;

    var Infix_$eq$pipe$eq = Int$BsAbstract.Infix.$eq$pipe$eq;

    var Infix_$less$pipe$pipe = Int$BsAbstract.Infix.$less$pipe$pipe;

    var Infix_$pipe$pipe$great = Int$BsAbstract.Infix.$pipe$pipe$great;

    var Infix_$less$pipe$eq = Int$BsAbstract.Infix.$less$pipe$eq;

    var Infix_$great$pipe$eq = Int$BsAbstract.Infix.$great$pipe$eq;

    var Infix_$pipe$plus$pipe = Int$BsAbstract.Infix.$pipe$plus$pipe;

    var Infix_$pipe$star$pipe = Int$BsAbstract.Infix.$pipe$star$pipe;

    var Infix_$pipe$$pipe = Int$BsAbstract.Infix.$pipe$neg$pipe;

    var Infix_$pipe$slash$pipe = Int$BsAbstract.Infix.$pipe$slash$pipe;

    var Infix_$pipe$percent$pipe = Int$BsAbstract.Infix.$pipe$percent$pipe;

    var Infix = {
      Additive: Infix_Additive,
      Multiplicative: Infix_Multiplicative,
      $eq$pipe$eq: Infix_$eq$pipe$eq,
      $less$pipe$pipe: Infix_$less$pipe$pipe,
      $pipe$pipe$great: Infix_$pipe$pipe$great,
      $less$pipe$eq: Infix_$less$pipe$eq,
      $great$pipe$eq: Infix_$great$pipe$eq,
      $pipe$plus$pipe: Infix_$pipe$plus$pipe,
      $pipe$star$pipe: Infix_$pipe$star$pipe,
      $pipe$neg$pipe: Infix_$pipe$$pipe,
      $pipe$slash$pipe: Infix_$pipe$slash$pipe,
      $pipe$percent$pipe: Infix_$pipe$percent$pipe
    };

    var zero = 0;

    var one = 1;

    var top = Js_int.max;

    var bottom = Js_int.min;

    var notEq = include.notEq;

    var compareAsInt = include$1.compareAsInt;

    var min = include$1.min;

    var max = include$1.max;

    var lessThan = include$1.lessThan;

    var lessThanOrEq = include$1.lessThanOrEq;

    var greaterThan = include$1.greaterThan;

    var greaterThanOrEq = include$1.greaterThanOrEq;

    var lt = include$1.lt;

    var lte = include$1.lte;

    var gt = include$1.gt;

    var gte = include$1.gte;

    var clamp = include$1.clamp;

    var between = include$1.between;

    var Named = include$1.Named;

    var $neg = include$2.$neg;

    var negate = include$2.negate;

    var abs = include$3.abs;

    var signum = include$3.signum;

    var toString = show;

    exports.toFloat = toFloat;
    exports.fromFloat = fromFloat;
    exports.zero = zero;
    exports.one = one;
    exports.add = add;
    exports.subtract = subtract;
    exports.multiply = multiply;
    exports.divide = divide;
    exports.modulo = modulo;
    exports.divideWithModulo = divideWithModulo;
    exports.divideAsFloat = divideAsFloat;
    exports.top = top;
    exports.bottom = bottom;
    exports.degree = degree;
    exports.rangeAsList = rangeAsList;
    exports.rangeAsArray = rangeAsArray;
    exports.eq = eq;
    exports.Eq = Eq;
    exports.notEq = notEq;
    exports.compare = compare;
    exports.Ord = Ord;
    exports.compareAsInt = compareAsInt;
    exports.min = min;
    exports.max = max;
    exports.lessThan = lessThan;
    exports.lessThanOrEq = lessThanOrEq;
    exports.greaterThan = greaterThan;
    exports.greaterThanOrEq = greaterThanOrEq;
    exports.lt = lt;
    exports.lte = lte;
    exports.gt = gt;
    exports.gte = gte;
    exports.clamp = clamp;
    exports.between = between;
    exports.OrdRingExtensions = OrdRingExtensions;
    exports.Named = Named;
    exports.Semiring = Semiring;
    exports.Ring = Ring;
    exports.$neg = $neg;
    exports.negate = negate;
    exports.abs = abs;
    exports.signum = signum;
    exports.Bounded = Bounded;
    exports.EuclideanRing = EuclideanRing;
    exports.$$Map = $$Map;
    exports.$$Set = $$Set;
    exports.show = show;
    exports.toString = toString;
    exports.Show = Show;
    exports.fromString = fromString;
    exports.Additive = Additive;
    exports.Multiplicative = Multiplicative;
    exports.Subtractive = Subtractive;
    exports.Divisive = Divisive;
    exports.Infix = Infix;
    /* include Not a pure module */