Blog Post

Small Basic Blog
2 MIN READ

Small Basic Featured Article: Parameter or Return Value Range for Math Function

Ed Price's avatar
Ed Price
Former Employee
Feb 13, 2019
First published on MSDN on Feb 11, 2016

Authored by Ed Price


See the full article from Nonki here:


Small Basic: Parameter or Return Value Range for Math Function



This article describes the ranges of parameters or return values for Small Basic Math functions.  This article is work in progress.  So "N/A" means that the range is not investigated yet.  Please edit this article here if you know any range information about Math functions in Small Basic.


Let's check out the article's TOC...


Table of Contents






Let's look at a few sample sections from this article:


Literal Numbers


This limitation is only for literal numbers but not for literal texts.  Following code shows this fact.



n = 1000000000000001

TextWindow . WriteLine ( n ) ' 1000000000000000

n = "1000000000000001"

TextWindow . WriteLine ( n ) ' 1000000000000001




Range


-1E15 = -1000000000000000 ≦ literal ≦ 1000000000000000 = 1E15


Sample Program


CSZ796






Math Functions


In Small Basic, Math object has 20 operations (functions).



Abs



Math.Abs(number)

ArcCos



Math.ArcCos(cosValue)


Range


-1 ≦ cosValue ≦ 1
0 ≦ Math.ArcCos(cosValue) ≦ Math.Pi



ArcSin



Math.ArcSin(sinValue)


Range


-1 ≦ sinValue ≦ 1
-Math.Pi / 2 ≦ Math.ArcSin(sinValue) ≦ Math.Pi / 2




Now go check out the full thing here:





This article is also available in French:




Special thanks to Nonki for providing this useful resource!


Have a Small and Basic day!

- Ninja Ed
Published Feb 13, 2019
Version 1.0
No CommentsBe the first to comment