|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
[C] Numero in formato esponenziale
Scusate il titolo criptico ma è possibile fare una operazione del genere:
Codice:
int c; c=-2.5374554e-005;
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
![]() |
![]() |
![]() |
#2 |
Member
Iscritto dal: Sep 2008
Città: Milano
Messaggi: 126
|
Credo proprio di sì.
Attento però che c è un int, perciò il valore viene convertito al volo (in questo caso viene troncato a zero). Può essere che il tuo compilatore ti dia un warning in merito. ciao! british |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
Quote:
Grazie
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
|
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Dec 2003
Messaggi: 4907
|
Che warning?
|
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
Codice:
main.c(1132) : warning C4552: '-' : operator has no effect; expected operator with side-effect Codice:
If an expression statement has an operator with no side effect as the top of the expression, it's probably a mistake. To override this warning, put the expression in parentheses. Codice:
c=(-2.5374554e-005);
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 14:04.