Cobol bugfix - convert to intrinsic function
Description:
Story
So you've been enjoying your daily life as a cobol programmer, when one day things changed. All of the sudden, the bosses came to you with unusual request: apparently the team of developers got sick and tired of having no ceiling
function for floating-point numbers, and so they decided to delegate this work to you. You didn't want to appear incompetent, so you simply went along with the request.
Wasting no time, you started writing your program, when a colleague of yours showed up before you could finish. The colleague looked at your program and started going off on a rant about how annoying it is to deal with calling sub-programs, and asked: "wouldn't it be cool if I could just call this like any other intrinsic function?". Again, you didn't want to argue, so you assured them that you would come up with something.
Unfortunately, you don't know how to write custom intrinsic functions, because you've only been dealing with programs and sub-programs all this time. Can you learn about this topic and finish this task before the deadline?
Task
Convert the given program to a computable custom intrinsic function. This function should be called 'ceiling' and it should calculate the smallest integer that is not smaller than n
. Your colleagues managed to set up some tests to make sure it works. To keep it simple, only small positive floating-point numbers will be tested. Good luck!
More information about how this function will be used can be seen in sample tests.
Similar Kata:
Stats:
Created | Nov 19, 2021 |
Published | Nov 20, 2021 |
Warriors Trained | 67 |
Total Skips | 0 |
Total Code Submissions | 69 |
Total Times Completed | 17 |
COBOL Completions | 17 |
Total Stars | 1 |
% of votes with a positive feedback rating | 94% of 8 |
Total "Very Satisfied" Votes | 7 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 4 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |