Skip to main content
deleted 13 characters in body
Source Link
Steadybox
  • 16.5k
  • 5
  • 41
  • 84

C preprocessor, 15 12 bytes

#define f 1/

Try it online!

16 13 bytes, if it needs to handle integer input also:

#define f 1./

So you can call it with f(3) instead of f(3.0).

Try it online!

Thanks to @hvd for golfing 3 bytes!

C preprocessor, 15 12 bytes

#define f 1/

Try it online!

16 13 bytes, if it needs to handle integer input also:

#define f 1./

So you can call it with f(3) instead of f(3.0).

Try it online!

Thanks to @hvd for golfing 3 bytes!

C, 15 12 bytes

#define f 1/

Try it online!

16 13 bytes, if it needs to handle integer input also:

#define f 1./

So you can call it with f(3) instead of f(3.0).

Try it online!

Thanks to @hvd for golfing 3 bytes!

added 49 characters in body
Source Link
Steadybox
  • 16.5k
  • 5
  • 41
  • 84

C preprocessor, 1515 12 bytes

#define f(x) 1/x

Try it online!Try it online!

1616 13 bytes, if it needs to handle integer input also:

#define f(x) 1./x

So you can call it with f(3) instead of f(3.0).

Try it online!Try it online!

Thanks to @hvd for golfing 3 bytes!

C preprocessor, 15 bytes

#define f(x)1/x

Try it online!

16 bytes, if it needs to handle integer input also:

#define f(x)1./x

So you can call it with f(3) instead of f(3.0).

Try it online!

C preprocessor, 15 12 bytes

#define f 1/

Try it online!

16 13 bytes, if it needs to handle integer input also:

#define f 1./

So you can call it with f(3) instead of f(3.0).

Try it online!

Thanks to @hvd for golfing 3 bytes!

added 272 characters in body
Source Link
Steadybox
  • 16.5k
  • 5
  • 41
  • 84

C preprocessor, 15 bytes

#define f(x)1/x

Try it online!

16 bytes, if it needs to handle integer input also:

#define f(x)1./x

So you can call it with f(3) instead of f(3.0).

Try it online!

C preprocessor, 15 bytes

#define f(x)1/x

Try it online!

C preprocessor, 15 bytes

#define f(x)1/x

Try it online!

16 bytes, if it needs to handle integer input also:

#define f(x)1./x

So you can call it with f(3) instead of f(3.0).

Try it online!

added 3 characters in body
Source Link
anna328p
  • 6.4k
  • 2
  • 32
  • 63
Loading
Source Link
Steadybox
  • 16.5k
  • 5
  • 41
  • 84
Loading