Skip to main content
deleted 11 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 112 101 9494 84 bytes

Thanks for the golfing tips from ceilingcat.

fn;f(s){float n=98,r=0;forr;for(;n;r+=1/pown=98;n;r+=pow(n--,-s));printf("%.5f",r+pow(99,-s+1s)*(.5+99./--s+pow(99,-++ss)/2);}

Try it online!Try it online!

C (gcc), 112 101 94 bytes

Thanks for the golfing tips from ceilingcat.

f(s){float n=98,r=0;for(;n;r+=1/pow(n--,s));printf("%.5f",r+pow(99,-s+1)/--s+pow(99,-++s)/2);}

Try it online!

C (gcc), 112 101 94 84 bytes

Thanks for the golfing tips from ceilingcat.

n;f(s){float r;for(n=98;n;r+=pow(n--,-s));printf("%.5f",r+pow(99,-s)*(.5+99./--s));}

Try it online!

added 51 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 112 101101 94 bytes

Thanks for the golfing tips from ceilingcat.

f(s){doublefloat nn=98,r=0;for(n=1;n<99;r+=1;n;r+=1/pow(n++n--,s));r+=pow;printf("%.5f",r+pow(99,-s+1)/--s+pow(99,-++s)/2;printf("%.5f",r2);}

Try it online!Try it online!

C (gcc), 112 101 bytes

f(s){double n,r=0;for(n=1;n<99;r+=1/pow(n++,s));r+=pow(99,-s+1)/--s+pow(99,-++s)/2;printf("%.5f",r);}

Try it online!

C (gcc), 112 101 94 bytes

Thanks for the golfing tips from ceilingcat.

f(s){float n=98,r=0;for(;n;r+=1/pow(n--,s));printf("%.5f",r+pow(99,-s+1)/--s+pow(99,-++s)/2);}

Try it online!

deleted 118 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 112 101 130 125101 bytes

Fixed to output ∞ now instead of inf

f(s){double n,r=0;for(n=1;n<99&&s>1;r+=1n=1;n<99;r+=1/pow(n++,s));r+=s<1?0:pow;r+=pow(99,-s+1)/--s+pow(99,-++s)/2;printf(s<2?"\u221e":"%.5f",r);}

Try it online!Try it online!

C (gcc), 112 101 130 125 bytes

Fixed to output ∞ now instead of inf

f(s){double n,r=0;for(n=1;n<99&&s>1;r+=1/pow(n++,s));r+=s<1?0:pow(99,-s+1)/--s+pow(99,-++s)/2;printf(s<2?"\u221e":"%.5f",r);}

Try it online!

C (gcc), 112 101 bytes

f(s){double n,r=0;for(n=1;n<99;r+=1/pow(n++,s));r+=pow(99,-s+1)/--s+pow(99,-++s)/2;printf("%.5f",r);}

Try it online!

deleted 6 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading
added 120 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading
Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading