View Single Post
Old 27-10-2008, 22:29   #76
Vincenzo1968
Bannato
 
Iscritto dal: Mar 2008
Cittā: Villabate(PA)
Messaggi: 2515
Quote:
Originariamente inviato da ||ElChE||88 Guarda i messaggi
Ma che azzo fa?
Se assegno EvalTree(pTree->left, szError) a dblLeft ed EvalTree(pTree->right, szError) a dblRight per ogni operazione(PLUS,MINUS,MULT,ecc) e poi uso le due variabili, funziona tutto perfettamente.
Se invece uso direttamente EvalTree(pTree->left, szError) ed EvalTree(pTree->right, szError) il risultato č sballato.


prova a mettere il suffisso L:

Codice:
case DIV:
	dblLeft = EvalTree(pTree->left, szError);
	dblRight = EvalTree(pTree->right, szError);
	if ( dblRight == 0.0L )
	{
		sprintf(szError, "Errore: divisione per zero!");
		return 0.0;
	}
	else
	{
		return dblLeft / dblRight;
	}
Vincenzo1968 č offline   Rispondi citando il messaggio o parte di esso