Comparing between normally distributed means Analyzing the difference between the means of two independent unbiased samples obtained from normally distributed variables with homogenous variances:
Two possible approaches:

*

*Perform a 2-sample t-test (H0: Mean1-Mean2=0)


*Calculate the 95% C.I of the difference between the means, and see
whether it overlaps 0.
Question: Is it mathematically possible to have a 95% C.I (of the difference between means) overlapping 0, and a t-test p<0.05?  Vice-versa: is it possible to have a 95% CI non overlapping 0 and a t-test p<0.05?

Provided the t test and the style of confidence interval match,
the two methods should give the same result. By 'match' I mean
that they should both be pooled variance procedures or both Welch
procedures, and both should be two-sided (or both one-sided) procedures.
This is roughly illustrated by The following fictitious normal data and the Welch two-sided procedure
t.test in R (without parameters var.eq=T, alt="less", or alt="g").
set.seed(2021)
x1 = rnorm(55, 100, 15)
x2 = rnorm(55, 110, 15)
t.test(x1,x2)

       Welch Two Sample t-test

data:  x1 and x2
t = -2.0026, df = 102.02, p-value = 0.04787
alternative hypothesis: 
  true difference in means is not equal to 0
95 percent confidence interval:
 -11.57271742  -0.05562016
sample estimates:
mean of x mean of y 
 99.11428 104.92845 

The P-value $0.04787$ is just a bit below 5% and the
95% confidence interval just barely avoids $0.$
