Skip to content

Commit

Permalink
unit test with negative nome
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Oct 31, 2023
1 parent 892269c commit 08b2781
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/internal.R
Expand Up @@ -40,7 +40,7 @@ check_and_get_tau <- function(tau, q){
stop("The nome `q` cannot be 0.")
}
if(Im(q) == 0 && Re(q) < 0) {
tau <- -1i * (log(abs(Re(q))) + 1i*pi) / pi
tau <- 1 - 1i * log(-Re(q)) / pi
} else {
tau <- -1i * log(q) / pi
}
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-jtheta.R
Expand Up @@ -9,6 +9,11 @@ test_that("Some values of jtheta functions.", {
expect_equal(jtheta4(0, q = q), -0.19172221286-0.25120246965i)
})

test_that("A jtheta3 value with negative nome.", {
q <- -0.730402691048646
expect_equal(jtheta3(1+1i, q = q), -23.82995222123 - 12.77832967427i)
})

test_that("jtheta1prime0 value.", {
q <- 0.556 + 0.283i
expect_equal(jtheta1prime0(q = q), 0.1966992019-1.4764061381i)
Expand Down

0 comments on commit 08b2781

Please sign in to comment.