Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMurr committed Nov 24, 2023
1 parent 925cba4 commit 38207cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions crates/compiler/builtins/bitcode/src/dec.zig
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ pub const RocDec = extern struct {

// (n / 0) is an error
if (denominator_i128 == 0) {
roc_panic("Decimal divison by 0!", 0);
roc_panic("Decimal division by 0!", 0);
}

// If they're both negative, or if neither is negative, the final answer
Expand Down Expand Up @@ -397,7 +397,7 @@ pub const RocDec = extern struct {
if (denominator_i128 == one_point_zero_i128) {
return self;
} else {
roc_panic("Decimal divison overflow in numerator!", 0);
roc_panic("Decimal division overflow in numerator!", 0);
unreachable;
}
};
Expand All @@ -411,7 +411,7 @@ pub const RocDec = extern struct {
if (numerator_i128 == one_point_zero_i128) {
return other;
} else {
roc_panic("Decimal divison overflow in denominator!", 0);
roc_panic("Decimal division overflow in denominator!", 0);
unreachable;
}
};
Expand All @@ -424,7 +424,7 @@ pub const RocDec = extern struct {
if (answer.hi == 0 and answer.lo <= math.maxInt(i128)) {
unsigned_answer = @as(i128, @intCast(answer.lo));
} else {
roc_panic("Decimal divison overflow!", 0);
roc_panic("Decimal division overflow!", 0);
}

return RocDec{ .num = if (is_answer_negative) -unsigned_answer else unsigned_answer };
Expand Down
2 changes: 1 addition & 1 deletion crates/compiler/builtins/bitcode/src/num.zig
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ pub fn exportDivCeil(comptime T: type, comptime name: []const u8) void {
comptime var f = struct {
fn func(a: T, b: T) callconv(.C) T {
return math.divCeil(T, a, b) catch {
roc_panic("Integer divison by 0!", 0);
roc_panic("Integer division by 0!", 0);
unreachable;
};
}
Expand Down
4 changes: 2 additions & 2 deletions crates/compiler/test_gen/src/gen_num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,14 +801,14 @@ fn gen_div_checked_by_zero_dec() {

#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[should_panic(expected = r#"Roc failed with message: "Decimal divison by 0!"#)]
#[should_panic(expected = r#"Roc failed with message: "Decimal division by 0!"#)]
fn gen_div_dec_by_zero() {
assert_evals_to!("1dec / 0", RocDec::from_str_to_i128_unsafe("-1"), i128);
}

#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[should_panic(expected = r#"Roc failed with message: "Integer divison by 0!"#)]
#[should_panic(expected = r#"Roc failed with message: "Integer division by 0!"#)]
fn gen_div_ceil_by_zero() {
assert_evals_to!(
r#"
Expand Down

0 comments on commit 38207cf

Please sign in to comment.