title: sigmoid function in python
body: <p>I am trying to understand why my sigmoid function when the input is 37, it output 1. the sigmoid function:</p>
  
  <pre><code>import math
  
  def sigmoid(x):
      return 1 / (1 + math.e ** -x)
  </code></pre>
  
  <p>I am not good in math but I think there should never be a moment where the f(x) is equal to 1 right? maybe it is because the e constant isnt precise enough however my real problem is I want to map a number between 0 and 1 to what is x when f(x) is 0 and what x is when f(x) is 1. my map function:</p>
  
  <pre><code>def p5map(n, start1, stop1, start2, stop2):
      return ((float(n)-start1)/(stop1-start1))*(stop2-start2)+start2
  </code></pre>
  
  <p>so for exemple I want to do </p>
  
  <pre><code>p5map(y, 0, 1, -37, 37)
  </code></pre>
  
  <p>where the y would be f(x) in the sigmoid curve and -37 and 37 would be where f(x) is 0 and 1 respectively. using -37 and 37 would not work for me so what I am asking is why is it 37 and how can I fix that so it is between -1 and 1 for exemple</p>