big commit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user