Jump to content

Display number closest to desired value


sphinx

Recommended Posts

scootstah, that wouldn't really be helpful if some of the numbers were OVER the target number.

 

sphinx, I'm afraid your answer is "subtraction."  Loop through all the numbers, subtract from 1000, find the abs() of the result, and find the lowest difference.  Same way you'd do it by hand.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.