Floor, Ceil and Rint

Sort by

recency

|

272 Discussions

|

  • + 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)

  • + 0 comments
    import numpy as np
    np.set_printoptions(legacy='1.13')
    A = np.array(tuple(map(float,input().split())))
    print("%s\n%s\n%s"%(np.floor(A),np.ceil(A),np.rint(A)))