1、 在程序中通过10条数据,证明标量a和标量b,|a•b|=|a|•|b|
时间: 2023-11-01 09:55:15 浏览: 143
在程序中可以通过以下10条数据来证明标量a和标量b的绝对值的乘积等于它们各自绝对值的乘积:
1. a = 2, b = 3
|a•b| = |2•3| = 6
|a|•|b| = |2|•|3| = 2•3 = 6
2. a = -5, b = 4
|a•b| = |-5•4| = 20
|a|•|b| = |-5|•|4| = 5•4 = 20
3. a = 0, b = 7
|a•b| = |0•7| = 0
|a|•|b| = |0|•|7| = 0•7 = 0
4. a = 1, b = -6
|a•b| = |1•-6| = 6
|a|•|b| = |1|•|-6| = 1•6 = 6
5. a = -8, b = -9
|a•b| = |-8•-9| = 72
|a|•|b| = |-8|•|-9| = 8•9 = 72
6. a = 3.5, b = 2.5
|a•b| = |3.5•2.5| = 8.75
|a|•|b| = |3.5|•|2.5| = 3.5•2.5 = 8.75
7. a = -2.3, b = 4.7
|a•b| = |-2.3•4.7| = 10.81
|a|•|b| = |-2.3|•|4.7| = 2.3•4.7 = 10.81
8. a = 1000000000, b = 0.000000001
|a•b| = |1000000000•0.000000001| = 1
|a|•|b| = |1000000000|•|0.000000001| = 1000000000•0.000000001 = 1
9. a = -123456789, b = 987654321
|a•b| = |-123456789•987654321| = 1.21987565531e+17
|a|•|b| = |-123456789|•|987654321| = 123456789•987654321 = 1.21987565531e+17
10. a = -3.14159, b = 2.71828
|a•b| = |-3.14159•2.71828| = 8.539734190052
|a|•|b| = |-3.14159|•|2.71828| = 3.14159•2.71828 = 8.539734190052
从以上的计算结果可以看出,无论标量a和标量b的取值如何,它们的乘积的绝对值始终等于它们各自绝对值的乘积。
阅读全文