Skip to content

Commit e1fdce1

Browse files
authored
Fix Scalar<DateTime> throwing DivideByZero (#476)
1 parent 6351890 commit e1fdce1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Maths/Silk.NET.Maths/Scalar.Constants.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ static Scalar()
308308
Pi = (T) (object) (ulong) FloatPi;
309309
Tau = (T) (object) (ulong) FloatTau;
310310
}
311+
else
312+
{
313+
// if it's none of these cases, don't do the general cases.
314+
return;
315+
}
311316

312317
PiOver2 = Scalar.Divide(Pi, Two);
313318
}

0 commit comments

Comments
 (0)