MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_trigonometric

Function test_trigonometric

src/functions/math_functions.rs:534–553  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

532
533 #[test]
534 fn test_trigonometric() {
535 let conn = Connection::open_in_memory().unwrap();
536 register_math_functions(&conn).unwrap();
537
538 // Test sin(pi/2) = 1
539 let result: f64 = conn.query_row(
540 "SELECT sin(pi() / 2)",
541 [],
542 |row| row.get(0)
543 ).unwrap();
544 assert!((result - 1.0).abs() < 1e-10);
545
546 // Test cos(0) = 1
547 let result: f64 = conn.query_row(
548 "SELECT cos(0)",
549 [],
550 |row| row.get(0)
551 ).unwrap();
552 assert_eq!(result, 1.0);
553 }
554
555 #[test]
556 fn test_logarithms() {

Callers

nothing calls this directly

Calls 2

register_math_functionsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected