Translations by Emanuele Rampichini

Emanuele Rampichini has submitted the following strings to this translation. Contributions are visually coded: currently used translations, unreviewed suggestions, rejected suggestions.

11 of 1 result
10.
The answer is the same, because multiplication is done before addition. In either equation, the two multiplication operations are performed first, and the results are added. However, the second equation is possibly slightly better than the first---because it's immediately obvious to the reader which operations are performed first. A less knowledgeable programmer (who doesn't know as much about the order of operations) might think that, in the first equation, you multiply 3 by 25, then add 10, then multiply the result by 32 (the answer to that is 2720---completely wrong). With the brackets, it's a bit more obvious what gets calculated first.
2011-01-11
La risposta è la stessa, perché la moltiplicazione viene fatta prima dell'addizione. In entrambe le equazioni, le due moltiplicazioni sono calcolate per prime, e i risultati vengono sommati. Comunque, la seconda equazione è migliore della prima, perché per il lettore è immediatamente ovvio quali calcoli vengono fatti per primi. Un programmatore poco esperto (che non ne sa molto sull'ordine delle operazioni) potrebbe pensare che, nella prima equazione, si moltiplichi 3 per 35, poi si aggiunga 10, e poi si moltiplichi il risultato per 32 (che dà come risultato 2720: completamente sbagliato). Con le parentesi, è più chiaro cosa viene calcolato prima.