λFPAI
Practice/Implement sigmoid function

Implement sigmoid function

Beginner

Implement the sigmoid function: sigma(x) = 1 / (1 + exp(-x)).

Input: One line with a single number x.

Output: sigmoid(x) rounded to 4 decimal places.

Example:

  • Input: 0
  • Output: 0.5
Loading editor...

Output

Run or submit to see output.