Skip to content
Snippets Groups Projects
Commit 9fe09392 authored by Dorchies David's avatar Dorchies David
Browse files

Merge branch 'exemple-simplification' into 'master'

Exemple de simplification de code

See merge request !28
parents 80f83404 a092bc6d
No related branches found
No related tags found
1 merge request!28Exemple de simplification de code
/**
* Stores app preferences
* @TODO save in cookie / localStorage ?
*/
export class ApplicationSetupService {
private _displayPrecision: number;
private _computePrecision: number;
private _newtonMaxIter: number;
constructor() {
this.defaults();
}
public defaults() {
this._displayPrecision = 0.001;
this._computePrecision = 0.0001;
this._newtonMaxIter = 50;
}
public get displayPrecision() {
return this._displayPrecision;
}
public set displayPrecision(p: number) {
this._displayPrecision = p;
}
public displayPrecision = 0.001;
public computePrecision = 0.0001;
public newtonMaxIter = 50;
public get displayDigits() {
return -Math.log10(this._displayPrecision);
}
public get computePrecision() {
return this._computePrecision;
}
public set computePrecision(p: number) {
this._computePrecision = p;
}
public get newtonMaxIter() {
return this._newtonMaxIter;
}
public set newtonMaxIter(p: number) {
this._newtonMaxIter = p;
return -Math.log10(this.displayPrecision);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment