Révision 246 pobysoPythonSage/src/sageSLZ/sageNumericalOperations.sage
sageNumericalOperations.sage (revision 246) | ||
---|---|---|
1 |
print "sageNumericalOperations: loading..." |
|
2 |
|
|
3 |
|
|
1 |
sys.stderr.write("sageNumericalOperations: loading...\n") |
|
2 |
# |
|
4 | 3 |
def sno_abs_is_power_of_two(number): |
5 | 4 |
""" |
6 | 5 |
Check if the absolute value of a number is power of 2. |
... | ... | |
9 | 8 |
""" |
10 | 9 |
return is_power_of_two(abs(number)) |
11 | 10 |
# End sno_abs_is_power_of_two(number): |
12 |
|
|
11 |
# |
|
13 | 12 |
def sno_float_to_rat_pow_of_two_denom(number): |
14 | 13 |
""" |
15 | 14 |
Convert a floating-point number into a rational where the denominator |
... | ... | |
26 | 25 |
return mantissa / 2^(-exponent) |
27 | 26 |
else: |
28 | 27 |
return -mantissa / 2^(-exponent) |
28 |
# End sno_float_to_rat_pow_of_two_denom. |
|
29 | 29 |
|
30 |
|
|
31 |
|
|
32 |
print "\t...sageNumericalOperations loaded." |
|
30 |
sys.stderr.write("\t...sageNumericalOperations loaded.\n") |
Formats disponibles : Unified diff