root / pobysoPythonSage / src / sageSLZ / sageNumericalOperations.sage @ 175
Historique | Voir | Annoter | Télécharger (392 octet)
| 1 | 172 | storres | print "sageNumericalOperations: loading..." |
|---|---|---|---|
| 2 | 172 | storres | |
| 3 | 172 | storres | def sno_abs_is_power_of_two(number): |
| 4 | 172 | storres | """ |
| 5 | 172 | storres | Check if the absolute value of a number is power of 2. |
| 6 | 172 | storres | The built-in is_power_of_two, works with many kinds of numbers but |
| 7 | 172 | storres | returns false for negative ones. |
| 8 | 172 | storres | """ |
| 9 | 172 | storres | return is_power_of_two(abs(number)) |
| 10 | 172 | storres | # End sno_abs_is_power_of_two(number): |
| 11 | 172 | storres | |
| 12 | 172 | storres | print "\t...sageNumericalOperations loaded." |