In[]:=
NIntegrate[(-1)^Floor[1/x],{x,0,1},Method->"MultiPeriodic"]
NIntegrate
:NIntegrate failed to converge to prescribed accuracy after 9 iterated refinements in x in the region {{0.,1.}}. NIntegrate obtained -0.387655 and 0.00272479 for the integral and error estimates.
Out[]=
-0.387655
In[]:=
NIntegrate[(-1)^Floor[1/x],{x,0,1},Method"MultiPeriodic",MaxRecursion20]
NIntegrate
:NIntegrate failed to converge to prescribed accuracy after 20 iterated refinements in x in the region {{0.,1.}}. NIntegrate obtained -0.386294 and 1.27514×
-6
10
for the integral and error estimates.
Out[]=
-0.386294
In[]:=
N[1-2Log[2]]
Out[]=
-0.386294