Powers of two: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

22 July 2023

20 July 2023

  • curprev 11:1611:16, 20 July 2023 Schwitters talk contribs 1,238 bytes +1,238 Created page with " """Find the nearest power of 2 below and above an input number, along with the diffs. """ import argparse import math import sys def nearest_powers_of_two(num, output=True): """Find the powers of 2 nearest the input num, along with the diffs. If optional parameter output == True (the default), print the values as well as returning them. Return value is a list of tuples [(low, lowdiff), (high, highdiff)]. """ lg = math.floor(math..." Tag: Visual edit: Switched