Beruflich Dokumente
Kultur Dokumente
Ulrich Hoffmann
uho@xlerb.de
• Einheiten
• Rechnen mit Einheiten
• Ein kurzer Blick in das Paket unum
Stück - einheitenlos
+ = ???
1kg · m
Kräfte in Newton (N) 1N =
s2
N kg · m kg
1pa = 1 2 = 1 2 2 = 1
m m ·s m · s2
>>> 2**64
18446744073709551616L
>>> aepfel=100
>>> entfernung=7500
>>> aepfel+entfernung
7600
>>>
>>> speed
10.3273778788 [m/s]
>>> speed.asUnit(mile/h)
23.1017437978 [mile/h]
>>> aepfel=100
>>> aepfel
100
>>> entfernung=7500*m
>>> entfernung
7500 [m]
>>> aepfel+entfernung
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "unum/__init__.py", line 394, in __radd__
return Unum.coerceToUnum(other).__add__(self)
File "unum/__init__.py", line 280, in __add__
s, o = self.matchUnits(Unum.coerceToUnum(other))
File "unum/__init__.py", line 269, in matchUnits
raise IncompatibleUnitsError(self, other)
unum.IncompatibleUnitsError: [] can't be converted to [m]
>>>
>>> s0-1.0/2.0*g*t*t
10.855 [m]
>>>
• piquant 0.1
• quantities 0.8.0
• units 0.04
Gibt es Fragen?
Donnerstag, 14. Oktober 2010