NEWTON

NEWTON


Popular tags

    How do I write a log based 2 function in Cairo?

    Asked

    5 months ago

    8

    views


    0

    Please make the function return the floor of the value so we are returned a felt

    Test 1

    Input(s): 4

    Output(s): 2

    Test 2

    Input(s): 16

    Output(s): 4

    Test 3

    Input(s): 127

    Output(s): 6

    Test 4

    Input(s): 1099511600000

    Output(s): 39

    This question was originally posted on Triality

      cairocairo-lang

    2 answers

    0

    Test #1

    Test #2

    Test #3

    Test #4

    This is a function that is optimized for any number between 1 and 2 ^ 125 currently

    This answer was originally posted on Triality

    answered

    6 months ago

    0

    Test #1

    Test #2

    Test #3

    Test #4

    This is a naive strategy that will work but is not optimized for large numbers

    This answer was originally posted on Triality

    answered

    6 months ago

    Your answer

    NEWTON

    NEWTON