ceiling

Code in PHP for the ceiling function

Anyone has ever programmed a PHP (or perl) function to get the ceiling value Excel style? TIA Roberto ...

Fractional Part of the number question.

What is a good algorithm to determine the necessary fraction needed to add/sub to the number in order to round it to the nearest integer without using the inbuilt ceiling or floor funcitons? Edit: Looking for a mathematical number trick to figure out the part needed to round the number to the nearest integer. The more primitive the mat...

problem with extending classes

Hello, I'm making Braid. I have a class Wall that prevents that an object goes into a wall. Everything with Wall is working. But now I'm trying to make the same with the ceilings. My ceiling class extends Wall. I've simply made a constructor like this: public Ceiling(boolean deadly, int[] xPositions, int[] yPositions) { super(dead...

Get ceiling integer from number in linux (BASH)

How would I do something like: ceiling(N/500) N representing a number. But in a linux bash script ...

What’s the Linq to SQL equivalent to CEILING?

How do I do this SELECT CEILING(COUNT(*) / 10) NumberOfPages FROM MyTable in Linq to SQL? ...

C# Math.Ceiling bug or not ?

I do not know why Ceiling behave like in the below image Why is processingFee != Settings.PaymentProcessingFeeInPercentage * prizesSum ? View image at full size ...

mysql double values checking problem

Hi everyone, I wanna make a query that fetches only the rows that has 'cost' value grader than zero.The cost column has double data type.When i write a query like that, select cost from xxx where cost>0; it retrieves the rows only that has value grader than or equal to one.For example it doesnt take like 0.02 or 0.3 values.The query ...

How to group by a price confined to a dynamically generated ceiling?

Hello, I have a table of items with several properties but to keep it short, it has property price. I want to group a List<Item> into groups of price ranges. The catch is that the price ranges (ceilings ...) have to be dynamically generated. When the ceilings are static, things work fine (Using LINQ) decimal[] ceilings = new decimal[...

I'm new to python, and trying to program a sales tax button for a calculator.

Hello, I just started programming in python not long ago, and I'm having trouble figuring out the rounding issue when it comes to tax and money. I can't seem to get decimals to always round up to the nearest hundredths place. for instance, in our state, sales takes is 9.5%, so a purchase of 5 dollars would make tax $.48, but in realit...