@@ -387,6 +387,22 @@ export let lt = (x: Int32, y: Int32) => {
387387 WasmI32.ltS(xv, yv)
388388}
389389
390+ /**
391+ * Checks if the first unsigned value is less than the second unsigned value.
392+ *
393+ * @param x: The first value
394+ * @param y: The second value
395+ * @returns `true` if the first value is less than the second value or `false` otherwise
396+ *
397+ * @since v0.5.0
398+ */
399+ @unsafe
400+ export let rec ltU = (x: Int32, y: Int32) => {
401+ let xv = WasmI32.load(WasmI32.fromGrain(x), 8n)
402+ let yv = WasmI32.load(WasmI32.fromGrain(y), 8n)
403+ WasmI32.ltU(xv, yv)
404+ }
405+
390406/**
391407 * Checks if the first value is greater than the second value.
392408 *
@@ -403,6 +419,22 @@ export let gt = (x: Int32, y: Int32) => {
403419 WasmI32.gtS(xv, yv)
404420}
405421
422+ /**
423+ * Checks if the first unsigned value is greater than the second unsigned value.
424+ *
425+ * @param x: The first value
426+ * @param y: The second value
427+ * @returns `true` if the first value is greater than the second value or `false` otherwise
428+ *
429+ * @since v0.5.0
430+ */
431+ @unsafe
432+ export let rec gtU = (x: Int32, y: Int32) => {
433+ let xv = WasmI32.load(WasmI32.fromGrain(x), 8n)
434+ let yv = WasmI32.load(WasmI32.fromGrain(y), 8n)
435+ WasmI32.gtU(xv, yv)
436+ }
437+
406438/**
407439 * Checks if the first value is less than or equal to the second value.
408440 *
@@ -419,6 +451,22 @@ export let lte = (x: Int32, y: Int32) => {
419451 WasmI32.leS(xv, yv)
420452}
421453
454+ /**
455+ * Checks if the first unsigned value is less than or equal to the second unsigned value.
456+ *
457+ * @param x: The first value
458+ * @param y: The second value
459+ * @returns `true` if the first value is less than or equal to the second value or `false` otherwise
460+ *
461+ * @since v0.5.0
462+ */
463+ @unsafe
464+ export let rec lteU = (x: Int32, y: Int32) => {
465+ let xv = WasmI32.load(WasmI32.fromGrain(x), 8n)
466+ let yv = WasmI32.load(WasmI32.fromGrain(y), 8n)
467+ WasmI32.leU(xv, yv)
468+ }
469+
422470/**
423471 * Checks if the first value is greater than or equal to the second value.
424472 *
@@ -435,6 +483,22 @@ export let gte = (x: Int32, y: Int32) => {
435483 WasmI32.geS(xv, yv)
436484}
437485
486+ /**
487+ * Checks if the first unsigned value is greater than or equal to the second unsigned value.
488+ *
489+ * @param x: The first value
490+ * @param y: The second value
491+ * @returns `true` if the first value is greater than or equal to the second value or `false` otherwise
492+ *
493+ * @since v0.5.0
494+ */
495+ @unsafe
496+ export let rec gteU = (x: Int32, y: Int32) => {
497+ let xv = WasmI32.load(WasmI32.fromGrain(x), 8n)
498+ let yv = WasmI32.load(WasmI32.fromGrain(y), 8n)
499+ WasmI32.geU(xv, yv)
500+ }
501+
438502/**
439503 * @section Bitwise logic: Boolean operations on the bits of Int32 values.
440504 */
0 commit comments