Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6020089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:31:02+00:00 2026-05-23T03:31:02+00:00

If you know that ‘input1’ is strictly between 0 and 1 or generally, ‘min’

  • 0

If you know that ‘input1’ is strictly between 0 and 1 or generally, ‘min’ and ‘max’ (where min and max are known to be between, but not strictly, 0 and 1), how would you get ‘input1’to increment or decrement by a numerical jump given by ‘input2’ with assurance that the new value is strictly between min and max and will never reach min or max?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:31:03+00:00Added an answer on May 23, 2026 at 3:31 am

    You need a distribution function, preferably an invertible one (the inverse is called quantile function).
    In other words, you need a monotone strictly increasing, continuous function f with lim[x->-oo] f(x) = 0 and lim[x->oo] f(x) = 1.

    If you have such a distribution function f and its inverse f⁻¹, then your adjusting function gets something like this:

    g (x, Δ) = f( f⁻¹(x) + Δ )
    

    This is for values between 0 and 1, for other intervals [a, b] we need to scale it, using a scaling function s:

    s(x) = (b-a)·x + a,     s⁻¹(y) = (y-a)/(b-a)
    

    Then the adjustment function gets

    h(x, Δ) = s(g(s⁻¹(x), Δ) = s( f( f⁻¹(s⁻¹(x)) + Δ )).
    

    One easily Java-calculable such distribution function would be

    f(x) = 1 - 0.5 * exp(-x)   for 0 ≤ x
    f(x) =     0.5 * exp( x)   for x ≤ 0
    

    with the quantile function

    f⁻¹(y) = - log(2 - 2y)  for   y ≤ 0.5
    f⁻¹(y) =   log(2 y)     for 0.5 ≤ y
    

    Building from this your adjustment function is just putting these together.

    Of course, this works only to the limits of your number precision – you can’t get arbitrary close to 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that design patterns is generally something that's connected to OO programming, but
I know that Chrome has a known bug not preserving the stacktrace when rethrowing
I know that Job.all returns an array of all jobs. But, what would be
I know that the entity framework does not currently support geo types but there
I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is
I know that IList is the interface and List is the concrete type but
I know that there are more than a dozen questions about this. But I
I know that ads colors can be set up in account settings, but I
I know that Lines of Code (LoC) is a dubious if not false code
I know that this isn't exactly normalised, but bringing all of the localised data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.