diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/sciteco.7.template | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/doc/sciteco.7.template b/doc/sciteco.7.template index 7a10f09..3971b71 100644 --- a/doc/sciteco.7.template +++ b/doc/sciteco.7.template @@ -1016,8 +1016,8 @@ however. In this specific build, numbers are @TECO_NUMBER@-bit. .LP .SCITECO_TOPIC integer float -A \*(ST number can be either a signed integer or floating point -number \(em it is dynamically typed. +A \*(ST number can be either a signed integer (two's complement) +or floating point number (according to IEEE 754) \(em it is dynamically typed. Integer constants create integers and floating point constants create floats. Operators create integers if all operands are integers, @@ -1076,6 +1076,10 @@ Floating point constants cannot currently contain exponents. Floating point constants beginning with \(lq0.\(rq are not octal. \# But ^O0.333 would be. You can also write e.g. @0ff.ff for hexadecimal \# floating point constants. But this is pretty useless to my knowledge. +.SCITECO_TOPIC infinity NaN +There is currently no special command or construct to represent +infinity or NaN (Not a Number), but you can use \(lq(0./0)\(rq +to get a NaN value and \(lq(1./0)\(rq to get a floating point infinity value. .LP A complete constant is pushed on the number stack, either as an integer or float. @@ -1091,6 +1095,7 @@ you can push a sequence of integers by space-separating them The following binary operators are supported with descending precedence, whereas borders separate operators of the \fIsame\fP precedence: +. .SCITECO_TT 90n .TS box,tab(;); @@ -1156,6 +1161,20 @@ Binary OR. T};\^ .TE .SCITECO_TT_END SP +. +.LP +.SCITECO_TOPIC overflow +When signed integers overflow the result is as if the operation was +performed modulo 2^*@TECO_NUMBER@. +Integer divisions by 0 produce an error. +Floating point divisions by 0 however result in infinity according to +IEEE 754. +Other values like \(lq0.0/0\(rq are undefined and result in special +NaN (not a number) floats. +A shift operation with a negative displacement shifts in the opposite +direction, i.e. \(lq1 ^> -1\(rq is equivalent to \(lq1 ^< 1\(rq. +Left shifts with a displacement of larger than or equal to @TECO_NUMBER@ +are always guaranteed to be 0. .LP .SCITECO_TOPIC associativity All binary operators are \fIleft-associative\fP, i.e. associate |
