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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:41:13+00:00 2026-05-31T11:41:13+00:00

I would say all programming languages have functions with these names to choose the

  • 0

I would say all programming languages have functions with these names to choose the lesser or greater of two values:

  • min() & max()
  • floor() & ceil() / ceiling()

And some languages have both. JavaScript I believe is one example.

I’ve always been a bit fuzzy on the difference between the former pair and the latter pair. I have a vague impression that min/max are more simplistic and floor/ceiling are more mathematical, but that’s not much to go on.

Oddly I can’t find this discussed anywhere on StackOverflow or the Internet generally by searching Google. So is there some best practices or rules of thumb to decide which of these functions to use when your programming language offers both?

  • 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-31T11:41:14+00:00Added an answer on May 31, 2026 at 11:41 am

    This is apples vs. oranges. In most languages/APIs, min/max take two (or more) inputs, and return the smallest/biggest. floor/ceil take one argument, and round it down or up to the nearest integer.

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

Sidebar

Related Questions

The questions says it all, just wondering, in an interview, what would you say
As much as we would all like to say it is a benefit to
I would like to be able to say things like cd [.fred] and have
How would I return multiple values (say, a number and a string) from a
In natural languages, we would say "some color is a primary color if the
Last night I was thining that programming languages can have a feature in which
This is a general question on programming style. Let's say I have an object
The android-app I'm programming is going to have a database of products, say 150-250
I have a number of classes that call say Trace.WriteLine(LogSomethingClassSpecific), in various methods all
This is only a half-way programming question. First of all I have a PCI-Express

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.