big commit

This commit is contained in:
2026-01-27 01:04:08 +01:00
parent 66933433d1
commit 5456c9414a
15 changed files with 821 additions and 222 deletions

View File

@@ -150,3 +150,53 @@ fn chain() {
fn underflow() {
expect_error("1 +", "stack underflow");
}
#[test]
fn pow_int() {
expect_int("2 3 pow", 8);
}
#[test]
fn pow_float() {
expect_float("2 0.5 pow", std::f64::consts::SQRT_2);
}
#[test]
fn sqrt() {
expect_int("16 sqrt", 4);
}
#[test]
fn sqrt_float() {
expect_float("2 sqrt", std::f64::consts::SQRT_2);
}
#[test]
fn sin_zero() {
expect_int("0 sin", 0);
}
#[test]
fn sin_pi_half() {
expect_float("3.14159265358979 2 / sin", 1.0);
}
#[test]
fn cos_zero() {
expect_int("0 cos", 1);
}
#[test]
fn cos_pi() {
expect_int("3.14159265358979 cos", -1);
}
#[test]
fn log_e() {
expect_float("2.718281828459045 log", 1.0);
}
#[test]
fn log_one() {
expect_int("1 log", 0);
}