diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-11-24 16:13:23 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-11-24 16:13:23 -0500 |
| commit | 0e10313d64f54dd587ebbcd5f413bd999333c911 (patch) | |
| tree | 16a07c4b01467d59807611b23f91f9eb125959e2 /examples/vectors/vectors.tm | |
| parent | 6ecf6a272446af04f3affd354520d21127a5b952 (diff) | |
Switch `NaN` to be identical to the null value
Diffstat (limited to 'examples/vectors/vectors.tm')
| -rw-r--r-- | examples/vectors/vectors.tm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/vectors/vectors.tm b/examples/vectors/vectors.tm index 696bef1e..b2533be4 100644 --- a/examples/vectors/vectors.tm +++ b/examples/vectors/vectors.tm @@ -17,7 +17,7 @@ struct Vec2(x,y:Num): func divided_by(v:Vec2, divisor:Num->Vec2; inline): return Vec2(v.x/divisor, v.y/divisor) func length(v:Vec2->Num; inline): - return (v.x*v.x + v.y*v.y):sqrt() + return (v.x*v.x + v.y*v.y)!:sqrt() func dist(a,b:Vec2->Num; inline): return a:minus(b):length() func angle(v:Vec2->Num; inline): @@ -50,7 +50,7 @@ struct Vec3(x,y,z:Num): func divided_by(v:Vec3, divisor:Num->Vec3; inline): return Vec3(v.x/divisor, v.y/divisor, v.z/divisor) func length(v:Vec3->Num; inline): - return (v.x*v.x + v.y*v.y + v.z*v.z):sqrt() + return (v.x*v.x + v.y*v.y + v.z*v.z)!:sqrt() func dist(a,b:Vec3->Num; inline): return a:minus(b):length() func norm(v:Vec3->Vec3; inline): |
