Almetare 1.20
Alle meine Taschenrechner - Eine C++-Bibliothek zur Entwicklung von Taschenrechnern
calc_fx85v.h
gehe zur Dokumentation dieser Datei
1//******************************************************************************
2// Copyright (c) 2002-2004 by Friedemann Seebass, Germany.
3// Dieses Programm ist freie Software. Siehe GNU GPL Notiz in Datei main.cpp.
4// This program is free software. See the GNU GPL notice in file main.cpp.
5// Projekt: Almetare - Alle meine Taschenrechner
6//******************************************************************************
11//******************************************************************************
12// Wann Wer Was
13// ---------- -------- ---------------------------------------------------------
14// 16.03.2003 fse Konstruktor CalculatorFx85v mit Argument argc
15// 01.03.2003 fse Konstruktor CalculatorFx85v mit Argument **argv
16// 05.05.2002 fse erzeugt
17//******************************************************************************
18
19#ifndef CALC_FX85V_H
20#define CALC_FX85V_H
21
22#ifndef __cplusplus
23#error calc_fx85v.h is only for C++!
24#endif
25
26//******************************************************************************
27
28#include "calc_casio_sci.h"
29
30using namespace std;
31
32//******************************************************************************
33
34class DisplayFx85v;
35
36//******************************************************************************
37// Klasse ComputerFx85v:
38//******************************************************************************
39
41
43{
46
48 bool preProcess(string& in);
49public:
51// ~ComputerFx85v();
52 bool map(string& sym);
53 bool getIsForcedSciTypeB() { return mIsForceSciTypeB; }
54 void setIsForcedSciTypeB(bool isOn) { mIsForceSciTypeB = isOn; }
55};
56
57//******************************************************************************
58// Klasse DisplayFx85v:
59//******************************************************************************
60
62
64{
66
67 void makeSeven(string displayStr = "");
68// int getNumStrLen(string numStr) const;
69 void setInv (bool on) { mInv = on ? "s" : "."; } // Casio fx-85v: "s"
70// string formatSciNumStr(string& numStr);
71protected:
72public:
74 void setModes();
75};
76
77//******************************************************************************
78// Klasse CalculatorFx85v:
79//******************************************************************************
80
82// fse, 01.03.03: Konstruktor mit Argument **argv
83
85{
86 const char mSep;
87 string nvRamToStr();
88 void restoreNvRam();
89public:
90 CalculatorFx85v(int argc, char** argv);
92};
93
94//******************************************************************************
95// zusaetzliche Symbole im Casio fx-85v:
96//************************* ************************* **************************
97
99
100class AcForceSci : public SymAction
101{
102public:
103 AcForceSci() : SymAction("force", "switch between forced SCI at x<0.01 or x<1e-7") {}
104 void process();
105};
106
107//************************* ************************* **************************
108
110
111class OpNpr : public SymOperator
112{
113public:
114 OpNpr() : SymOperator("npr", 6, "permutation nPr with repetition") {}
115 Number calcVal(const Number& a, const Number& b)
116 { return Number(Util::fact(a.getVal()) / Util::fact((a-b).getVal())); }
117 void process() { processCommon(); }
118};
119
120//************************* ************************* **************************
121
123
124class OpNcr : public SymOperator
125{
126public:
127 OpNcr() : SymOperator("ncr", 6, "combination nCr without repetition") {}
128 Number calcVal(const Number& a, const Number& b)
129 { return Number(Util::fact(a.getVal()) / Util::fact(b.getVal()) / Util::fact((a-b).getVal())); }
130 void process() { processCommon(); }
131};
132
133//****************** ******************* ******************* *******************
134
136
138{
139public:
140 FnCbrt() : SymOtherFunction("cbrt", "cubic root") {}
141 Number calcVal(const Number& a) { return Number(Util::root(a.getVal(), 3.0)); }
142
143};
144
145//******************************************************************************
146//************************************** ***************************************
147//************************* ************************* **************************
148
149#endif // !CALC_FX85V_H
Gemeinsame Klassen fuer wissenschaftliche Casio-Rechner (Modul special).
Erzwingt gegebenenfalls SCI-Anzeige schon bei Werten kleiner 0,01 statt 1e-7.
Definition: calc_fx85v.h:101
void process()
Der Casio fx-85v hat zwei Einstellungen fuer die Darstellung kleiner Zahlen.
Definition: calc_fx85v.cpp:415
Basisklasse aller Taschenrechner.
Definition: calculator.h:245
Die Klasse implementiert den Calculator des Casio fx-85v.
Definition: calc_fx85v.h:85
string nvRamToStr()
Schreibt die permanenten Daten (K-Register, M-Speicher) in String.
Definition: calc_fx85v.cpp:372
const char mSep
Separator fuer nvRam-String in der Konf.datei.
Definition: calc_fx85v.h:86
~CalculatorFx85v()
Achtung: Aufraeumen wird im wesentlichen von ~CalculatorBase() uebernommen! Hier werden nur die persi...
Definition: calc_fx85v.cpp:355
CalculatorFx85v(int argc, char **argv)
Konstruktor des Calculators.
Definition: calc_fx85v.cpp:282
void restoreNvRam()
Der NV-RAM-String aus der Konfigurationsdatei wird geparsed und die Daten in die entsprechenden Varia...
Definition: calc_fx85v.cpp:313
Basisklasse aller Computer.
Definition: calculator.h:85
Gemeinsame Basisklasse aller wissenschaftlichen Casio-Rechner.
Definition: calc_casio_sci.h:44
Die Klasse implementiert den Computer des Casio fx-85v.
Definition: calc_fx85v.h:43
bool mIsForceSciTypeB
true, wenn SCI erst bei Zahlen kleiner 1e-7
Definition: calc_fx85v.h:45
void addCasioFx85SymsToSymTab()
Fuegt der Symboltabelle spezielle fx-85v-Symbole hinzu.
Definition: calc_fx85v.cpp:199
bool preProcess(string &in)
Fuehrt Pre-Processing des Symbols durch.
Definition: calc_fx85v.cpp:226
ComputerFx85v()
Konstruktor fuegt der Symboltabelle spezielle fx-85v-Symbole hinzu.
Definition: calc_fx85v.cpp:188
bool map(string &sym)
Mapped das uebergebene Symbol gegebenenfalls auf ein anderes Symbol um.
Definition: calc_fx85v.cpp:246
DisplayFx85v * mDisplayFx85vP
Zeiger auf das Display des Rechners.
Definition: calc_fx85v.h:44
Klasse der Anzeige aller wissenschaftlichen Casio-Rechner.
Definition: calc_casio_sci.h:103
Die Klasse implementiert die Anzeige des Casio fx-85v.
Definition: calc_fx85v.h:64
DisplayFx85v(ComputerBase *cbP)
Konstruktor des Displays.
Definition: calc_fx85v.cpp:47
void setModes()
Schaut im Computer, welche Modes gesetzt sind, und baut den Mode-String des Displays entsprechend zus...
Definition: calc_fx85v.cpp:59
void makeSeven(string displayStr="")
Erzeugt Anzeige-String.
Definition: calc_fx85v.cpp:124
ComputerFx85v * mCompP
Zeiger auf den Computer des Rechners.
Definition: calc_fx85v.h:65
Kubikwurzel.
Definition: calc_fx85v.h:138
Die Klasse Number repraesentiert Zahlen.
Definition: number.h:49
Permutation ohne Wiederholung.
Definition: calc_fx85v.h:125
Permutation mit Wiederholung.
Definition: calc_fx85v.h:112
Basisklasse fuer alle Aktionen ("=", "%", ...).
Definition: symbols.h:278
Basisklasse fuer die Operatoren.
Definition: symbols.h:104
void processCommon()
Prozessiert einen eingegebenen Operator.
Definition: symbols.cpp:255
Basisklasse der Nicht-Winkelfunktionen.
Definition: symbols.h:253
static double fact(double n)
Berechnet rekursiv die Fakultaet n! der Zahl n.
Definition: util.cpp:993
static double root(double x, double y)
Berechnet x^(1/y).
Definition: util.cpp:1015