Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

need help getting the number nearest as 12 but not greater than 12

Featured Replies

Here's my scenario, I need to divide a number that could result as nearest as 12 but nut exceed to 12

Example

50 / 5 = 10

70 / 7 = 11.66

What i need is the divisor to put so the result would be as nearest as 12 not equal or greater than 12.

 

4 hours ago, archrid404 said:

70 / 7 = 11.66

I don't think so.

Assuming you want a whole divisor that returns a result closest to 12 but never equal to or greater than 12, start by dividing the number by 12. If the result is a whole number, bump it up by 1. Otherwise bump it up to the nearest whole number:

Let ( 
divisor = number / 12 
;
If ( Mod ( divisor ; 1 ) ; Ceiling ( divisor ) ; divisor + 1 )
)

Or shortly:

Div ( number ; 12 ) + 1

This will produce a divisor of 5 for the number 50 (50/5 = 10) and 6 for the number of 70 (70/6=11.6666666666666667).

 

Edited by comment

  • Author

Ok got it now thanks.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.