From 0e10313d64f54dd587ebbcd5f413bd999333c911 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 24 Nov 2024 16:13:23 -0500 Subject: Switch `NaN` to be identical to the null value --- examples/vectors/vectors.tm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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): -- cgit v1.2.3