Wie 0,4 x 60 rechnen

Persönliche Seite #1144821
Lesenswert?

Keine.
1
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
2
Type "copyright", "credits" or "license()" for more information.
3

4
    ****************************************************************
5
    Personal firewall software may warn about the connection IDLE
6
    makes to its subprocess using this computer's internal loopback
7
    interface.  This connection is not visible on any external
8
    interface and no data is sent to or received from the Internet.
9
    ****************************************************************
10
    
11
IDLE 1.2      
12
>>> x=0.4
13
>>> y=60
14
>>> x*y
15
24.0
16
>>>
Gast #1146573
Lesenswert?

Am schennlsten gehts, wenn man "x = 0.4 * 60" schreibt, dann wirds 
nämlich schon vom Preprocessor berechnet und als Konstante abgelegt.
Ansonsten würde ich einfach float nehmen, moderne Prozessoren im PC 
rechnen damit fast so schnell wie mit normalen integern.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren