Floor, Ceil and Rint

Sort by

recency

|

273 Discussions

|

  • + 0 comments
    import numpy
    
    numpy.set_printoptions(legacy='1.13')
    
    my_arr = list(map(float, input().split()))
    
    print(numpy.floor(my_arr))
    print(numpy.ceil(my_arr))
    print(numpy.rint(my_arr))
    
  • + 0 comments
    import numpy as np
    np.set_printoptions(legacy='1.13')
    
    actions = ["floor", "ceil", "rint"]
    
    a = list(map(float, input().split()))
    
    for action in actions:
        result = getattr(np, action)(a)
        print(result)
    
  • + 0 comments

    dont miss this numpy.set_printoptions(legacy='1.13')

    import numpy
    numpy.set_printoptions(legacy='1.13')
    my_array = list(map(float,input().split()))
    print(numpy.floor(my_array) )
    print(numpy.ceil(my_array) )
    print(numpy.rint(my_array) )
    
  • + 0 comments

    import numpy as np np.set_printoptions(legacy='1.13') m = (list(map(float,input().split()))) coms = 'np.floor np.ceil np.rint'.split() [print(eval(f'{com}({m})')) for com in coms]

  • + 0 comments

    import numpy as np

    np.set_printoptions(legacy='1.13')

    def floor_ceil_rint(x): function_list = ['floor' ,'ceil' ,'rint']

    for i in function_list:
        func = getattr(np, i)
        print(func(x))
    

    sample_input = list(map(float, input().split())) floor_ceil_rint(sample_input)