Search code examples
operatorsquantum-computingqcl

floor and ceil from QCL (Quantum Computer Language)


I'm working on QCL and some questions came up about internal functions. I'd like to know what the operators floor(something) and ceil(something) are. I know they are related to math operations, but what do they do exactly?


Solution

  • Floor removes the decimal point, ceil turns the decimal part into .9999 repeating if it's already there (which is the same as a whole number).

    So floor(4.6) loses the .6, ceil(4.6) becomes 4.9999... or 5. Also, ceil(5.0) will return 5, as the decimal part is 0.