7 kyu

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.

Fundamentals
Debugging

More By Author:

Check out these other kata created by B1ts

Stats:

CreatedNov 19, 2021
PublishedNov 20, 2021
Warriors Trained67
Total Skips0
Total Code Submissions69
Total Times Completed17
COBOL Completions17
Total Stars1
% of votes with a positive feedback rating94% of 8
Total "Very Satisfied" Votes7
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes0
Total Rank Assessments4
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • B1ts Avatar
  • dfhwze Avatar
Ad