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 4097248
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:08:58+00:00 2026-05-20T20:08:58+00:00

var loc3:*=Math.min(Math.max(arg2 / arg1.things, 0), 1); If somebody could breakdown what this line of

  • 0

var loc3:*=Math.min(Math.max(arg2 / arg1.things, 0), 1);

If somebody could breakdown what this line of code is doing, i’d greatly appreciate it.

  • 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-20T20:08:59+00:00Added an answer on May 20, 2026 at 8:08 pm

    You could rewrite it in the following sequence of steps:

    VALUE1 = arg2 / arg1.things      // STEP 1   divide arg2 by arg1.things
    VALUE2 = Math.max(VALUE1, 0)     // STEP 2   if the value of the division at step 1
                                                is less then 0, set the value to 0
    VALUE3 = Math.min(VALUE2, 1)     // STEP 3   if the value is greater than 1
                                                set the value to 1
    VALUE4 = loc3 * VALUE3           // STEP 4   multiply the value by the current value 
                                                 stored in loc3
    var loc3 = VALUE4;               // STEP 5   and set the final value back to loc3
    

    So, to summarize, what that line of code does is it divides the value of arg2 by the values stored in arg1.things and it caps the result in the closed interval [0,1] and then it multiplies the value stored in loc3 by the capped, computed result of the division. The final result is stored back in the loc3 variable.

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

Sidebar

Related Questions

var selector = $(this); What is the proper code to change the custom attribute
var t={a:1,b:2} is this an Object with properties (a,b) or it is a Javascript
var UsersMenu = function(){ this.returnUsers = []; this.retrieve = function(posts){ var temp = [];
var valueAsText = $('#counts span').text(); I use this tiny script to parse a span
var plugin = { Init: function() { this.UpdateUI(); if (this.Status() == 1) { ...
var MyObj = function(h,w){ this.height = h; this.width = w; } I would like
var currentLeft = $(this).css('left'); if((currentLeft%2)== 0){ thisLeft = currentLeft; } I want to set
var flag = 0/1 (default=1) I want this flag to checked every 30sec over
var coords = {'x' : 982, 'y' : 1002 }; The above code is
var q = (from Comments in db.tblBlogComments where Comments.blogID == this.ID orderby Comments.date descending

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.