• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

How can I make numbers less extreem by a decimal value?

x is a number between 0.00000001 and 1.  If x is 1 then y should remain exactly the same. If the number is 0.00000001 then y should be very close to 1.

I need this in JavaScript but I can write the JavaScript code if you can help me with the logic.

Thanks!
0
hankknight
Asked:
hankknight
  • 2
1 Solution
 
ozoCommented:
y = Math.pow(y,x)
0
 
hankknightAuthor Commented:
Wow!  Perfect, thanks.
0
 
ozoCommented:
or
y = (y-1)*x + 1
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now