mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 06:50:27 +00:00
utilities:: kz
This commit is contained in:
parent
7ba8b2d680
commit
0054dbc118
21
util.cpp
21
util.cpp
@ -283,4 +283,25 @@ string parser_help() {
|
||||
}
|
||||
|
||||
logger hlog;
|
||||
|
||||
// kz: utility for printing
|
||||
// if it is close to 0, assume it is floating errors
|
||||
|
||||
ld kz(ld x) {
|
||||
if(abs(x) < 1e-6) return 0;
|
||||
return x;
|
||||
}
|
||||
|
||||
hyperpoint kz(hyperpoint h) {
|
||||
for(int d=0; d<MAXMDIM; d++) h[d] = kz(h[d]);
|
||||
return h;
|
||||
}
|
||||
|
||||
transmatrix kz(transmatrix h) {
|
||||
for(int d=0; d<MAXMDIM; d++)
|
||||
for(int e=0; e<MAXMDIM; e++)
|
||||
h[d][e] = kz(h[d][e]);
|
||||
return h;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user