From 09e53d69e7c5a386f80794c17327b612b1bec3f8 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Wed, 25 Jun 2025 09:00:23 +0200 Subject: [PATCH 1/4] docs: add more space between header icons --- docs/overrides/stylesheets/extra.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/overrides/stylesheets/extra.css b/docs/overrides/stylesheets/extra.css index 166c3ec81..1c7b4ac5e 100644 --- a/docs/overrides/stylesheets/extra.css +++ b/docs/overrides/stylesheets/extra.css @@ -107,7 +107,7 @@ } .md-header__button { - margin: 0; + margin: 2px; padding: 2px; } From 6238f5013f76b2d2c40a57d6ca82a9e7949fff05 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Wed, 25 Jun 2025 09:00:58 +0200 Subject: [PATCH 2/4] doc: fix CHANGELOG.md versioning --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 952157f1c..4d1bf6906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -[v1.18.0](https://github.com/boriel-basic/zxbasic/tree/v1.18.1) +[v1.18.1](https://github.com/boriel-basic/zxbasic/tree/v1.18.1) === + ! Fixes crash on simple cast from i32 to u32 and vice versa From 19c3ce0c62c0e66e0ff708469c469d0b1198177f Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Wed, 25 Jun 2025 09:05:40 +0200 Subject: [PATCH 3/4] docs: fix CSS for screens up to 1220px wide --- docs/overrides/stylesheets/extra.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/overrides/stylesheets/extra.css b/docs/overrides/stylesheets/extra.css index 1c7b4ac5e..3a81f3722 100644 --- a/docs/overrides/stylesheets/extra.css +++ b/docs/overrides/stylesheets/extra.css @@ -34,7 +34,7 @@ } /* Responsive adjustments for smaller screens */ -@media screen and (max-width: 768px) { +@media screen and (max-width: 1220px) { [data-md-color-scheme="default"] .md-header { height: 3.5rem; } From 443459cda1c28c0c3218053d8bc6c8f87970b055 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Sun, 29 Jun 2025 12:57:54 +0200 Subject: [PATCH 4/4] docs: Add SGN.md page This fixes #871 --- docs/sgn.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/sgn.md diff --git a/docs/sgn.md b/docs/sgn.md new file mode 100644 index 000000000..c314471c0 --- /dev/null +++ b/docs/sgn.md @@ -0,0 +1,34 @@ +# SGN + +## Syntax +```basic +SGN(expression) +``` + +## Description + +Returns the sign of a numeric expression as follows: +* -1 if the number is negative +* 0 if the number is zero +* 1 if the number is positive + +The returned value type is [byte](types.md#Byte). + +## Examples + +```basic +REM Print sign of different numbers +PRINT "Sign of -5 is "; SGN(-5) ' Prints -1 +PRINT "Sign of 0 is "; SGN(0) ' Prints 0 +PRINT "Sign of 3.14 is "; SGN(3.14) ' Prints 1 +``` + +## Remarks + +* This function is 100% Sinclair BASIC Compatible +* If the argument is an unsigned value, the result will always be either 0 or 1 +* Using SGN with string expressions will result in a compile-time error + +## See also + +* [ABS](abs.md)