mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 01:00:25 +00:00
arcm:: no longer crashes with divby0 on some incorrect strings
This commit is contained in:
parent
2958564622
commit
1fe234fe75
@ -1177,12 +1177,14 @@ string archimedean_tiling::world_size() {
|
||||
}
|
||||
anom *= 2 * denom, adenom *= nom;
|
||||
int g = gcd(anom, adenom);
|
||||
anom /= g; adenom /= g;
|
||||
if(g != 0) {
|
||||
anom /= g; adenom /= g;
|
||||
}
|
||||
if(adenom < 0) anom = -anom, adenom = -adenom;
|
||||
string s;
|
||||
bool hyp = (anom < 0);
|
||||
if(hyp) anom = -anom;
|
||||
if(adenom > 1)
|
||||
if(adenom != 1)
|
||||
s += its(anom) + "/" + its(adenom);
|
||||
else
|
||||
s += its(anom);
|
||||
|
Loading…
Reference in New Issue
Block a user