Note that a simple majority must be 1 more than 50% so that the vote does not equal a tie. You were mistaken as to the meaning in that case. Thus, a simple majority of a 40 vote chamber must be 21 votes. There are some situations in which a odd number of votes is cast so that the difference is one vote, while in an even number of votes, the minimum difference is two votes.
There are some situations in which the by-laws require a minimum difference of two votes. For example, in ancient Israel, the high court (of 71 justices) was not allowed to convict in a capital case unless the majority for conviction was by at least two votes. A vote of 37 - 34 could convict, while a vote of 36 - 35 could not even though it was a majority (of 1) for guilty.
In many cases, it often means present and voting. This means that many votes require a certain minimum casting ballots (a quorum) and the actual number of votes counted will be used to determine the "majority" or the minimum number required in a vote of some special type (such as the 3/5 majority that you mention). This means that if some members abstain, they will not be counted and the majority will be that of the votes actually counted.
Since the percentage is the minimum required for an action, the result will be the fewest votes that are above the actual (fractional) vote counted. This means that the best pattern would be
ceil(x) because that takes into account that the the case when the number of votes is exactly divisible. For example
.6(40) = 24 so that
floor() == ceil(). However, the U.S. Senate 2/3 majority must be 67 votes because the exact fraction of 66.66666 means that floor(200/3) would be less that the minimum amount.
Each body has its own rules as to what is considered a quorum, either a specific fixed number or a percentage of the total number of members (usually a majority).