Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2008-11-25 15:33:04

AlgorithmDesign&Analysis
Guest

Round up to nearest integer?

What's the appropriate notation for rounding an expression up to the nearest integer?

Example: 2.1 yields 3.

I wish I would have paid attention in my precalculus class...this notation is coming back to haunt me as a computer science major taking Algorithm Design and Analysis.

Thanks!

#2 2008-11-25 16:27:49

AlgorithmDesign&Analysis
Guest

Re: Round up to nearest integer?

I think I've figured it out.  My best guess is ⌈x⌉.  If that's not it, it's ⌊x⌋.  Pretty sure it's the first one.  Can someone confirm this?

Thanks!

#3 2008-11-26 00:01:01

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: Round up to nearest integer?

Yep, it's the first one. The second one always rounds down.
In computing, ceil(x) and floor(x) respectively are commonly used.


Why did the vector cross the road?
It wanted to be normal.

Offline

Board footer

Powered by FluxBB