Warum rechnet mein Sinus 0 ???



  • Also ich hab mir nen singleton gebaut das sinus table, etc sein wird.

    Der Konstruktor berechnet also meine Sinus Tabelle..

    MyMath::MyMath() {
        if (instance != NULL) {
            throw ("There is already an instence. please use getInstance");
        }
        instance = this;
    
        float erg;
        float val;
        for (int i = 0; i < 360; i++) {
            val = static_cast<float>(i) * 3.1415926 / 180.0;
            erg = sin (val);
            this->sintab[i] = erg;
            #ifdef TEST
                cout << i << ")\tsinus of " << val << " is " << erg << endl
            #endif 
        }
    }
    

    sö..
    Was jetzt nicht funktioniert ist der sinus. Dieser liefert immer 0 zurück.
    But why?



  • Du hast nicht zufällig eine Memberfunktion namens sin in dieser Klasse?



  • natürlich hab ich trottel die.

    Ich sollte mehr Kaffee trinken..


Anmelden zum Antworten